Skip to content

Commit 9c476e3

Browse files
Added composable types
1 parent 57151d3 commit 9c476e3

File tree

1 file changed

+50
-17
lines changed

1 file changed

+50
-17
lines changed

src/types/index.ts

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/* eslint-disable no-unused-vars */
2+
import type {
3+
CSSProperties,
4+
Ref,
5+
} from 'vue';
26
import type {
37
VBtn,
48
VCheckbox,
@@ -135,15 +139,41 @@ export interface SaveFieldButtons extends Required<Pick<SharedProps,
135139

136140

137141
// -------------------------------------------------- Composables //
142+
export interface UseDisplayContainerClass {
143+
(
144+
name: string,
145+
valueColor: string,
146+
options: {
147+
disabled?: Ref<boolean> | boolean;
148+
empty?: Ref<boolean> | boolean;
149+
error?: Ref<boolean> | boolean;
150+
},
151+
): object;
152+
}
153+
154+
export interface UseFieldDisplayStyles {
155+
(
156+
options: {
157+
color: string;
158+
error: Ref<boolean> | boolean;
159+
underlineColor: string;
160+
underlineStyle: string;
161+
underlineWidth: string;
162+
underlined: boolean;
163+
}
164+
): CSSProperties;
165+
}
166+
138167
export interface UseToggleField {
139168
(
140-
itemId: number,
141-
showField: boolean,
142-
attrs: object,
143-
props: object,
144-
timeOpened: TimeOpened,
145-
closeSiblings: boolean,
146-
fieldOnly: boolean,
169+
options: {
170+
attrs: object,
171+
closeSiblings: boolean,
172+
fieldOnly: boolean,
173+
props: object,
174+
showField: Ref<boolean> | boolean,
175+
timeOpened: TimeOpened,
176+
}
147177
): {
148178
settings: {
149179
[key: string]: string | unknown;
@@ -152,18 +182,21 @@ export interface UseToggleField {
152182
timeOpened: TimeOpened,
153183
};
154184
}
185+
155186
export interface UseSaveValue {
156187
(
157-
settings: {
158-
[key: string]: string | unknown;
159-
},
160-
emit: {
161-
(e: 'loading', response: boolean): void;
162-
(e: 'error', error: AxiosError): AxiosError;
163-
(e: 'update', response: unknown): void;
164-
},
165-
name: string,
166-
value: FieldValue,
188+
options: {
189+
settings: {
190+
[key: string]: string | unknown;
191+
},
192+
emit: {
193+
(e: 'loading', response: boolean): void;
194+
(e: 'error', error: AxiosError): AxiosError;
195+
(e: 'update', response: unknown): void;
196+
},
197+
name: string,
198+
value: FieldValue,
199+
}
167200
): Promise<{ [key: string]: string | unknown; } | undefined>;
168201
}
169202

0 commit comments

Comments
 (0)