types: add SwipeInstance type (#9158)
This commit is contained in:
@@ -4,7 +4,6 @@ import {
|
||||
InjectionKey,
|
||||
defineComponent,
|
||||
ExtractPropTypes,
|
||||
ComponentPublicInstance,
|
||||
} from 'vue';
|
||||
|
||||
// Utils
|
||||
@@ -16,7 +15,12 @@ import { useExpose } from '../composables/use-expose';
|
||||
import { useLinkField } from '../composables/use-link-field';
|
||||
|
||||
// Types
|
||||
import { CheckerParent, CheckerDirection } from '../checkbox/Checker';
|
||||
import type { CheckerDirection } from '../checkbox/Checker';
|
||||
import type {
|
||||
CheckboxGroupExpose,
|
||||
CheckboxGroupProvide,
|
||||
CheckboxGroupToggleAllOptions,
|
||||
} from './types';
|
||||
|
||||
const [name, bem] = createNamespace('checkbox-group');
|
||||
|
||||
@@ -32,28 +36,7 @@ const props = {
|
||||
},
|
||||
};
|
||||
|
||||
export type CheckboxGroupToggleAllOptions =
|
||||
| boolean
|
||||
| {
|
||||
checked?: boolean;
|
||||
skipDisabled?: boolean;
|
||||
};
|
||||
|
||||
type CheckboxGroupProps = ExtractPropTypes<typeof props>;
|
||||
|
||||
type CheckboxGroupExpose = {
|
||||
toggleAll: (options?: CheckboxGroupToggleAllOptions) => void;
|
||||
};
|
||||
|
||||
export type CheckboxGroupInstance = ComponentPublicInstance<
|
||||
CheckboxGroupProps,
|
||||
CheckboxGroupExpose
|
||||
>;
|
||||
|
||||
export type CheckboxGroupProvide = CheckerParent & {
|
||||
props: CheckboxGroupProps;
|
||||
updateValue: (value: unknown[]) => void;
|
||||
};
|
||||
export type CheckboxGroupProps = ExtractPropTypes<typeof props>;
|
||||
|
||||
export const CHECKBOX_GROUP_KEY: InjectionKey<CheckboxGroupProvide> = Symbol(
|
||||
name
|
||||
|
||||
@@ -8,4 +8,4 @@ export { CheckboxGroup };
|
||||
export type {
|
||||
CheckboxGroupInstance,
|
||||
CheckboxGroupToggleAllOptions,
|
||||
} from './CheckboxGroup';
|
||||
} from './types';
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { CheckboxGroupProps } from './CheckboxGroup';
|
||||
import type { CheckerParent } from '../checkbox/Checker';
|
||||
|
||||
export type CheckboxGroupToggleAllOptions =
|
||||
| boolean
|
||||
| {
|
||||
checked?: boolean;
|
||||
skipDisabled?: boolean;
|
||||
};
|
||||
|
||||
export type CheckboxGroupExpose = {
|
||||
toggleAll: (options?: CheckboxGroupToggleAllOptions) => void;
|
||||
};
|
||||
|
||||
export type CheckboxGroupInstance = ComponentPublicInstance<
|
||||
CheckboxGroupProps,
|
||||
CheckboxGroupExpose
|
||||
>;
|
||||
|
||||
export type CheckboxGroupProvide = CheckerParent & {
|
||||
props: CheckboxGroupProps;
|
||||
updateValue: (value: unknown[]) => void;
|
||||
};
|
||||
Reference in New Issue
Block a user