Skip to content

Commit ee4be77

Browse files
Adding and updadting types
1 parent 0082f53 commit ee4be77

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed
File renamed without changes.

src/types/index.ts

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import {
2121
export type FieldValue = string | boolean | number | object | [] | null | { [key: string]: string | unknown; };
2222
export type TimeOpened = Date | null;
2323

24+
export type GlobalDensity = VCheckbox['$props']['density'] | VSelect['$props']['density'] | VSwitch['$props']['density'] | VTextField['$props']['density'] | VTextarea['$props']['density'];
25+
26+
export type GlobalVariant = VSelect['$props']['variant'] | VTextField['$props']['variant'] | VTextarea['$props']['variant'];
27+
28+
2429

2530
// -------------------------------------------------- Props //
2631
export interface SharedProps {
@@ -49,20 +54,21 @@ export interface SharedProps {
4954
iconTrueColor?: string;
5055
iconTrueTitle?: string | undefined;
5156
icons?: boolean;
52-
item: Record<string, unknown>;
57+
item?: Record<string, unknown>;
5358
label?: string;
5459
loadingIcon?: string;
5560
loadingIconColor?: string;
5661
method?: string;
5762
// TODO: Change this to optional. Throw error if using apiRoute and not providing a name. //
58-
name: string;
63+
name?: string;
5964
required?: boolean;
6065
saveButtonColor?: VBtn['$props']['color'];
6166
saveButtonSize?: VBtn['$props']['size'];
6267
saveButtonTitle?: string | undefined;
6368
saveButtonVariant?: VBtn['$props']['variant'];
6469
saveIcon?: string;
6570
saveIconColor?: string;
71+
tableField?: boolean;
6672
trueValue?: boolean | string;
6773
truncateLength?: number | undefined;
6874
truncateSuffix?: string | undefined;
@@ -108,6 +114,7 @@ export interface VInlineTextareaProps extends Omit<SharedProps,
108114
> {
109115
autoGrow?: VTextarea['$props']['autoGrow'];
110116
density?: VTextarea['$props']['density'];
117+
rows?: VTextarea['$props']['rows'];
111118
rules?: VTextarea['$props']['rules'];
112119
variant?: VTextarea['$props']['variant'];
113120
}
@@ -149,7 +156,46 @@ export interface SaveFieldButtons extends Required<Pick<SharedProps,
149156

150157

151158
// -------------------------------------------------- Composables //
159+
160+
// ------------------------ Main Container //
161+
export interface UseInlineFieldsContainerClass {
162+
(
163+
options: {
164+
density?: GlobalDensity;
165+
field?: Ref<string> | string;
166+
tableField?: SharedProps['tableField'];
167+
},
168+
): object;
169+
}
170+
171+
// ------------------------ Display Value Container //
152172
export interface UseDisplayContainerClass {
173+
(
174+
options: {
175+
density?: GlobalDensity;
176+
field?: Ref<string> | string;
177+
},
178+
): object;
179+
}
180+
181+
export interface UseDisplayInputControlClass {
182+
(
183+
options: {
184+
density?: GlobalDensity;
185+
variant?: GlobalVariant;
186+
},
187+
): object;
188+
}
189+
190+
export interface UseDisplaySelectionControlClass {
191+
(
192+
options: {
193+
density?: GlobalDensity;
194+
},
195+
): object;
196+
}
197+
198+
export interface UseDisplayValueClass {
153199
(
154200
name: string,
155201
valueColor: string,
@@ -161,6 +207,17 @@ export interface UseDisplayContainerClass {
161207
): object;
162208
}
163209

210+
// ------------------------ Field Container //
211+
export interface UseFieldContainerClass {
212+
(
213+
options: {
214+
active?: Ref<boolean> | boolean;
215+
name?: Ref<string> | string;
216+
},
217+
): object;
218+
}
219+
220+
// ------------------------ Other //
164221
export interface UseCheckForErrors {
165222
(
166223
options: {
@@ -174,7 +231,7 @@ export interface UseCheckForErrors {
174231
};
175232
}
176233

177-
export interface UseFieldDisplayStyles {
234+
export interface UseDisplayValueStyles {
178235
(
179236
options: {
180237
color: SharedProps['color'];

0 commit comments

Comments
 (0)