@hybridly/vue 0.10.0-beta.3 → 0.10.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,120 +1,326 @@
1
- import * as vue0 from "vue";
2
- import { App, ComputedRef, DeepReadonly, DefineComponent, MaybeRefOrGetter, Plugin, Ref, h } from "vue";
3
- import { GlobalHybridlyProperties, HybridRequestOptions, Method, Plugin as Plugin$1, Progress, RouteName, RouteParameters, RouterContext, RouterContextOptions, UrlResolvable, can, registerHook as registerHook$1, route, router } from "@hybridly/core";
4
- import { FormDataConvertible, RequestData } from "@hybridly/utils";
5
- import { Path, PathValue, SearchableObject } from "@clickbar/dot-diver";
1
+ import { FormDataConvertible, Path, PathValue, RequestData, SearchableObject } from "@hybridly/utils";
2
+ import * as vue from "vue";
3
+ import { App, Component, ComputedRef, DeepReadonly, DefineComponent, MaybeRefOrGetter, Plugin, PropType, Ref, SlotsType, h } from "vue";
4
+ import * as _hybridly_core0 from "@hybridly/core";
5
+ import { Errors, GlobalHybridlyProperties, HttpClient, HybridRequestOptions, Method, NavigationResponse, Plugin as Plugin$1, Progress, RequestMode, RouteName, RouteParameters, RouterContext, RouterContextOptions, UrlResolvable, Validation, registerHook as registerHook$1, route, router } from "@hybridly/core";
6
+ import { Path as Path$1, SearchableObject as SearchableObject$1 } from "@clickbar/dot-diver";
6
7
 
7
- //#region ../hybridly/src/index.d.ts
8
-
9
- import * as import__hybridly_core from "@hybridly/core";
10
- //#endregion
11
- //#region src/plugins/progress.d.ts
12
- interface ProgressOptions {
13
- /**
14
- * The delay after which the progress bar will
15
- * appear during navigation, in milliseconds.
16
- *
17
- * @default 250
18
- */
19
- delay: number;
20
- /**
21
- * The color of the progress bar.
22
- *
23
- * Defaults to #29d.
24
- */
25
- color: string;
26
- /**
27
- * Whether to include the default NProgress styles.
28
- *
29
- * Defaults to true.
30
- */
31
- includeCSS: boolean;
32
- /**
33
- * Whether the NProgress spinner will be shown.
34
- *
35
- * Defaults to false.
36
- */
37
- spinner: boolean;
8
+ //#region src/components/load-state.d.ts
9
+ interface LoadStateSlotProps {
10
+ reloading: boolean;
11
+ loading: boolean;
12
+ loaded: boolean;
38
13
  }
39
14
  //#endregion
40
- //#region src/composables/property.d.ts
41
- type Property$1 = string | number | boolean | Property$1[] | {
42
- [name: string]: Property$1;
43
- };
44
- type InternalProperties = GlobalHybridlyProperties & {
45
- [key: string]: Property$1;
46
- };
47
- /** Accesses all current properties. */
48
- declare function useProperties<T extends object, Global extends InternalProperties = InternalProperties>(): vue0.DeepReadonly<vue0.UnwrapNestedRefs<T & Global>>;
49
- /** Accesses a property with a dot notation. */
50
- declare function useProperty<Override = never, T extends SearchableObject = GlobalHybridlyProperties, P extends Path<T> & string = Path<T> & string, ReturnType = ([Override] extends [never] ? PathValue<T, P> : Override)>(path: [Override] extends [never] ? P : string): ComputedRef<ReturnType>;
51
- /**
52
- * Sets the property at the given path to the given value.
53
- * Note: this helper is experimental and may change in the future.
54
- */
55
- declare function setProperty<Override = never, T extends SearchableObject = GlobalHybridlyProperties, P extends Path<T> & string = Path<T> & string, ValueType = ([Override] extends [never] ? PathValue<T, P> : Override)>(path: [Override] extends [never] ? P : string, value: ValueType): void;
15
+ //#region src/components/deferred.d.ts
16
+ declare const Deferred: vue.DefineComponent<vue.ExtractPropTypes<{
17
+ data: {
18
+ type: PropType<string | string[]>;
19
+ required: true;
20
+ };
21
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
22
+ [key: string]: any;
23
+ }>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
24
+ data: {
25
+ type: PropType<string | string[]>;
26
+ required: true;
27
+ };
28
+ }>> & Readonly<{}>, {}, SlotsType<{
29
+ default: LoadStateSlotProps;
30
+ fallback: LoadStateSlotProps;
31
+ }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
56
32
  //#endregion
57
33
  //#region src/composables/form.d.ts
58
- type Errors<T extends SearchableObject> = { [K in keyof T]?: T[K] extends Record<string, any> ? Errors<T[K]> : string };
59
- type DefaultFormOptions = Pick<FormOptions<object>, 'timeout' | 'reset' | 'updateInitials' | 'progress' | 'preserveScroll' | 'preserveState' | 'preserveUrl' | 'headers' | 'errorBag' | 'spoof' | 'transformUrl' | 'updateHistoryState' | 'useFormData'>;
60
- interface FormOptions<T extends SearchableObject> extends Omit<HybridRequestOptions, 'data' | 'url'> {
61
- fields: T;
34
+ type Errors$1<T extends SearchableObject$1> = { [K in keyof T]?: T[K] extends Record<string, any> ? Errors$1<T[K]> : string };
35
+ type FormFieldBehavior$1 = boolean | string[];
36
+ type DefaultFormOptions = Pick<FormOptions<object>, 'timeout' | 'resetOnSuccess' | 'resetOnError' | 'setDefaultOnSuccess' | 'progress' | 'preserveScroll' | 'preserveState' | 'preserveUrl' | 'headers' | 'errorBag' | 'spoof' | 'transformUrl' | 'updateHistoryState' | 'useFormData'>;
37
+ type FormSubmitOptions$1<T extends SearchableObject$1> = Omit<HybridRequestOptions, 'data' | 'url' | 'reset'> & {
62
38
  url?: UrlResolvable | (() => UrlResolvable);
63
- key?: string | false;
64
39
  /**
65
40
  * Defines the delay after which the `recentlySuccessful` and `recentlyFailed` variables are reset to `false`.
66
41
  */
67
42
  timeout?: number;
68
43
  /**
69
- * Resets the fields of the form to their initial value after a successful submission.
44
+ * Resets the fields of the form to their default value after a successful submission.
70
45
  * @default true
71
46
  */
72
- reset?: boolean;
47
+ resetOnSuccess?: FormFieldBehavior$1;
73
48
  /**
74
- * Updates the initial values from the form after a successful submission.
49
+ * Resets the fields of the form to their default value after a failed submission.
75
50
  * @default false
76
51
  */
77
- updateInitials?: boolean;
52
+ resetOnError?: FormFieldBehavior$1;
53
+ /**
54
+ * Updates the default values from the form after a successful submission.
55
+ * @default false
56
+ */
57
+ setDefaultOnSuccess?: FormFieldBehavior$1;
78
58
  /**
79
59
  * Callback executed before the form submission for transforming the fields.
80
60
  */
81
61
  transform?: (fields: T) => any;
62
+ };
63
+ type FormAutomaticallySubmitOptions<T extends SearchableObject$1> = true | (FormSubmitOptions$1<T> & {
64
+ /**
65
+ * Debounce delay in milliseconds before submitting automatically.
66
+ * @default 100
67
+ */
68
+ debounce?: number;
69
+ /**
70
+ * Whether to immediately submit the form on any change. If `false`, submits after the `debounce` delay.
71
+ * @default true
72
+ */
73
+ immediate?: boolean;
74
+ });
75
+ interface FormOptions<T extends SearchableObject$1> extends FormSubmitOptions$1<T> {
76
+ fields: T;
77
+ key?: string | false;
78
+ /**
79
+ * Automatically submits the form when fields change.
80
+ * Pass `true` to use defaults or an object to customize submit overrides and debounce delay.
81
+ */
82
+ automaticallySubmit?: FormAutomaticallySubmitOptions<T>;
82
83
  }
83
- interface FormReturn<T extends SearchableObject, P extends Path<T> & string = Path<T> & string> {
84
+ interface FormReturn<T extends SearchableObject$1, P extends Path$1<T> & string = Path$1<T> & string> {
84
85
  resetFields: (...keys: P[]) => void;
85
86
  reset: () => void;
86
87
  resetSubmissionState: () => void;
87
88
  clear: (...keys: P[]) => void;
88
89
  fields: T;
89
90
  abort: () => void;
90
- setErrors: (incoming: Errors<T>) => void;
91
+ setErrors: (incoming: Errors$1<T>) => void;
91
92
  clearErrors: (...keys: P[]) => void;
92
93
  clearError: (key: P) => void;
93
- setInitial: (newInitial: Partial<T>) => void;
94
+ setDefault: (newDefault: Partial<T>) => void;
94
95
  hasDirty: (...keys: P[]) => boolean;
95
- submitWith: (optionsOverrides?: Omit<FormOptions<T>, 'fields' | 'key'>) => Promise<any>;
96
- submitWithOptions: (optionsOverrides?: Omit<FormOptions<T>, 'fields' | 'key'>) => Promise<any>;
97
- submit: () => Promise<any>;
96
+ submit: (optionsOverrides?: FormSubmitOptions$1<T>) => Promise<any>;
98
97
  hasErrors: boolean;
99
- initial: DeepReadonly<T>;
98
+ defaults: DeepReadonly<T>;
100
99
  loaded: DeepReadonly<T>;
101
100
  progress: Progress | undefined;
102
101
  isDirty: boolean;
103
- errors: Errors<T>;
102
+ errors: Errors$1<T>;
104
103
  processing: boolean;
105
104
  successful: boolean;
106
105
  failed: boolean;
107
106
  recentlySuccessful: boolean;
108
107
  recentlyFailed: boolean;
109
108
  }
110
- declare function useForm<T extends SearchableObject, P extends Path<T> & string = Path<T> & string>(options: FormOptions<T>): FormReturn<T, P>;
109
+ declare function useForm<T extends SearchableObject$1, P extends Path$1<T> & string = Path$1<T> & string>(options: FormOptions<T>): FormReturn<T, P>;
111
110
  //#endregion
112
- //#region src/composables/history.d.ts
113
- /**
114
- * Returns a ref with a value saved in the history state through Hybridly.
115
- * The state is linked to a specific browser history entry.
116
- */
117
- declare function useHistoryState<T = any>(key: string, initial: T): Ref<T>;
111
+ //#region src/components/form.d.ts
112
+ type DefaultFormFields = Record<string, any>;
113
+ type FormInternalSubmitOptions<T extends SearchableObject$1 = DefaultFormFields> = NonNullable<Parameters<FormReturn<T>['submit']>[0]>;
114
+ type FormFieldBehavior = boolean | string[];
115
+ type FormRequestOptions = Omit<HybridRequestOptions, 'url' | 'data' | 'method' | 'errorBag' | 'progress'>;
116
+ type FormSubmitOptions<T extends SearchableObject$1 = DefaultFormFields> = FormInternalSubmitOptions<T>;
117
+ type FormSlotProps<T extends SearchableObject$1 = DefaultFormFields> = Omit<FormReturn<T>, 'submit' | 'reset' | 'resetFields' | 'errors'> & {
118
+ errors: Record<string, any>;
119
+ getError: (key: string) => any;
120
+ submit: (optionsOverrides?: FormSubmitOptions<T>) => Promise<any>;
121
+ reset: () => void;
122
+ resetFields: (...keys: string[]) => void;
123
+ };
124
+ interface FormProps {
125
+ action?: string;
126
+ method?: Method | Lowercase<Method>;
127
+ options?: FormRequestOptions;
128
+ errorBag?: string;
129
+ showProgress?: boolean;
130
+ disableWhileProcessing?: boolean;
131
+ resetOnSuccess?: FormFieldBehavior;
132
+ resetOnError?: FormFieldBehavior;
133
+ setDefaultOnSuccess?: FormFieldBehavior;
134
+ }
135
+ declare const Form: vue.DefineComponent<vue.ExtractPropTypes<{
136
+ action: {
137
+ type: StringConstructor;
138
+ required: false;
139
+ default: undefined;
140
+ };
141
+ method: {
142
+ type: PropType<NonNullable<FormProps["method"]>>;
143
+ default: "POST";
144
+ };
145
+ options: {
146
+ type: PropType<FormRequestOptions>;
147
+ default: () => {};
148
+ };
149
+ errorBag: {
150
+ type: StringConstructor;
151
+ required: false;
152
+ default: undefined;
153
+ };
154
+ showProgress: {
155
+ type: BooleanConstructor;
156
+ required: false;
157
+ default: undefined;
158
+ };
159
+ disableWhileProcessing: {
160
+ type: BooleanConstructor;
161
+ default: false;
162
+ };
163
+ resetOnSuccess: {
164
+ type: PropType<FormFieldBehavior>;
165
+ default: true;
166
+ };
167
+ resetOnError: {
168
+ type: PropType<FormFieldBehavior>;
169
+ default: false;
170
+ };
171
+ setDefaultOnSuccess: {
172
+ type: PropType<FormFieldBehavior>;
173
+ default: false;
174
+ };
175
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
176
+ [key: string]: any;
177
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
178
+ action: {
179
+ type: StringConstructor;
180
+ required: false;
181
+ default: undefined;
182
+ };
183
+ method: {
184
+ type: PropType<NonNullable<FormProps["method"]>>;
185
+ default: "POST";
186
+ };
187
+ options: {
188
+ type: PropType<FormRequestOptions>;
189
+ default: () => {};
190
+ };
191
+ errorBag: {
192
+ type: StringConstructor;
193
+ required: false;
194
+ default: undefined;
195
+ };
196
+ showProgress: {
197
+ type: BooleanConstructor;
198
+ required: false;
199
+ default: undefined;
200
+ };
201
+ disableWhileProcessing: {
202
+ type: BooleanConstructor;
203
+ default: false;
204
+ };
205
+ resetOnSuccess: {
206
+ type: PropType<FormFieldBehavior>;
207
+ default: true;
208
+ };
209
+ resetOnError: {
210
+ type: PropType<FormFieldBehavior>;
211
+ default: false;
212
+ };
213
+ setDefaultOnSuccess: {
214
+ type: PropType<FormFieldBehavior>;
215
+ default: false;
216
+ };
217
+ }>> & Readonly<{}>, {
218
+ action: string;
219
+ method: NonNullable<Method | "get" | "post" | "put" | "patch" | "delete" | undefined>;
220
+ options: FormRequestOptions;
221
+ errorBag: string;
222
+ showProgress: boolean;
223
+ disableWhileProcessing: boolean;
224
+ resetOnSuccess: FormFieldBehavior;
225
+ resetOnError: FormFieldBehavior;
226
+ setDefaultOnSuccess: FormFieldBehavior;
227
+ }, SlotsType<{
228
+ default: FormSlotProps;
229
+ }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
230
+ //#endregion
231
+ //#region src/components/link.d.ts
232
+ interface RouterLinkProps {
233
+ href?: string;
234
+ as?: string | object;
235
+ method?: Method | Lowercase<Method>;
236
+ mode?: RequestMode;
237
+ data?: RequestData;
238
+ external?: boolean;
239
+ disabled?: boolean;
240
+ options?: Omit<HybridRequestOptions, 'url' | 'data' | 'method'>;
241
+ text?: string;
242
+ preload?: boolean | 'hover' | 'mount';
243
+ preserveScroll?: boolean;
244
+ preserveState?: boolean;
245
+ }
246
+ declare const RouterLink: DefineComponent<RouterLinkProps>;
247
+ //#endregion
248
+ //#region src/components/when-visible.d.ts
249
+ declare const WhenVisible: vue.DefineComponent<vue.ExtractPropTypes<{
250
+ as: {
251
+ type: StringConstructor;
252
+ default: string;
253
+ };
254
+ data: {
255
+ type: PropType<string | string[]>;
256
+ required: true;
257
+ };
258
+ buffer: {
259
+ type: NumberConstructor;
260
+ default: number;
261
+ };
262
+ root: {
263
+ type: PropType<string | Element | null>;
264
+ default: null;
265
+ };
266
+ once: {
267
+ type: BooleanConstructor;
268
+ default: boolean;
269
+ };
270
+ fallbackOnHidden: {
271
+ type: BooleanConstructor;
272
+ default: boolean;
273
+ };
274
+ options: {
275
+ type: PropType<Omit<HybridRequestOptions, "url" | "data" | "method">>;
276
+ default: () => {};
277
+ };
278
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
279
+ [key: string]: any;
280
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
281
+ loading: (_state: LoadStateSlotProps) => true;
282
+ }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
283
+ as: {
284
+ type: StringConstructor;
285
+ default: string;
286
+ };
287
+ data: {
288
+ type: PropType<string | string[]>;
289
+ required: true;
290
+ };
291
+ buffer: {
292
+ type: NumberConstructor;
293
+ default: number;
294
+ };
295
+ root: {
296
+ type: PropType<string | Element | null>;
297
+ default: null;
298
+ };
299
+ once: {
300
+ type: BooleanConstructor;
301
+ default: boolean;
302
+ };
303
+ fallbackOnHidden: {
304
+ type: BooleanConstructor;
305
+ default: boolean;
306
+ };
307
+ options: {
308
+ type: PropType<Omit<HybridRequestOptions, "url" | "data" | "method">>;
309
+ default: () => {};
310
+ };
311
+ }>> & Readonly<{
312
+ onLoading?: ((_state: LoadStateSlotProps) => any) | undefined;
313
+ }>, {
314
+ options: Omit<HybridRequestOptions<Record<string, any>>, "data" | "method" | "url">;
315
+ as: string;
316
+ buffer: number;
317
+ root: string | Element | null;
318
+ once: boolean;
319
+ fallbackOnHidden: boolean;
320
+ }, SlotsType<{
321
+ default: LoadStateSlotProps;
322
+ fallback: LoadStateSlotProps;
323
+ }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
118
324
  //#endregion
119
325
  //#region src/composables/back-forward.d.ts
120
326
  type BackForwardCallback = (context: RouterContext) => void;
@@ -129,6 +335,74 @@ declare function useBackForward(options?: UseBackForwardOptions): {
129
335
  reloadOnBackForward: (options?: HybridRequestOptions) => void;
130
336
  };
131
337
  //#endregion
338
+ //#region src/composables/bulk-select.d.ts
339
+ interface BulkSelection<T = any> {
340
+ /** Whether all records are selected. */
341
+ all: boolean;
342
+ /** Included records. */
343
+ only: Set<T>;
344
+ /** Excluded records. */
345
+ except: Set<T>;
346
+ }
347
+ /**
348
+ * Returns the inclusive range between two records in the given order.
349
+ *
350
+ * This is useful for implementing shift-click bulk selection: keep track of the last selected anchor,
351
+ * then pass the currently visible record identifiers and the clicked target identifier to this helper.
352
+ * If the target is not in the list, an empty range is returned. If the anchor is missing, only the target is returned.
353
+ */
354
+ declare function getBulkSelectionRange<T>(records: readonly T[], anchor: T | undefined, target: T): T[];
355
+ declare function useBulkSelect<T = any>(): {
356
+ allSelected: vue.ComputedRef<boolean>;
357
+ anySelected: vue.ComputedRef<boolean>;
358
+ toggleAll: (force?: boolean) => void;
359
+ selectAll: () => void;
360
+ deselectAll: () => void;
361
+ select: (...records: T[]) => void;
362
+ deselect: (...records: T[]) => void;
363
+ toggle: (record: T, force?: boolean) => void;
364
+ selected: (record: T) => boolean;
365
+ selection: Ref<BulkSelection<T>, BulkSelection<T>>;
366
+ bindCheckbox: (key: T) => {
367
+ onChange: (event: Event) => void;
368
+ checked: boolean;
369
+ value: T;
370
+ };
371
+ };
372
+ //#endregion
373
+ //#region src/composables/current-route.d.ts
374
+ declare function useRoute(): {
375
+ isNavigating: Readonly<vue.Ref<boolean, boolean>>;
376
+ current: Readonly<vue.Ref<string | undefined, string | undefined>>;
377
+ matches: <T extends RouteName>(name: MaybeRefOrGetter<T>, parameters?: RouteParameters<T>) => boolean;
378
+ };
379
+ import * as import__hybridly_core from "@hybridly/core";
380
+ //#endregion
381
+ //#region ../core/src/router/types.d.ts
382
+ type Property$1 = null | string | number | boolean | Property$1[] | {
383
+ [name: string]: Property$1;
384
+ };
385
+ type Properties = Record<string | number, Property$1>;
386
+ //#endregion
387
+ //#region src/composables/dialog.d.ts
388
+ /**
389
+ * Exposes utilities related to the dialogs.
390
+ */
391
+ declare function useDialog(): {
392
+ /** Closes the dialog. */close: () => Promise<void | index_d_exports.NavigationResponse>; /** Closes the dialog without a server round-trip. */
393
+ closeLocally: () => Promise<void | index_d_exports.NavigationResponse>; /** Unmounts the dialog. Should be called after its closing animations. */
394
+ unmount: () => void; /** Whether the dialog is shown. */
395
+ show: vue.WritableComputedRef<boolean | undefined, boolean | undefined>; /** Properties of the dialog. */
396
+ properties: vue.ComputedRef<Properties | undefined>;
397
+ };
398
+ //#endregion
399
+ //#region src/composables/history.d.ts
400
+ /**
401
+ * Returns a ref with a value saved in the history state through Hybridly.
402
+ * The state is linked to a specific browser history entry.
403
+ */
404
+ declare function useHistoryState<T = any>(key: string, initial: T): Ref<T>;
405
+ //#endregion
132
406
  //#region src/composables/paginator.d.ts
133
407
  declare global {
134
408
  /**
@@ -200,293 +474,576 @@ interface PaginatorMeta {
200
474
  prev_page_url?: string;
201
475
  }
202
476
  type MaybeWithData<T> = T | Omit<T, 'data'>;
203
- type PaginatorResult<T, P> = P extends MaybeWithData<Paginator<T>> ? P & {
204
- to: (page: number) => Promise<index_d_exports.NavigationResponse> | undefined;
477
+ type PaginatorResult<T, P = MaybeWithData<Paginator<T>>> = P extends MaybeWithData<Paginator<T>> ? P & {
478
+ to: (page: number, options?: Omit<index_d_exports.HybridRequestOptions, 'method' | 'url'>) => Promise<index_d_exports.NavigationResponse> | undefined;
205
479
  } : P;
206
- declare function createPaginator<T, P extends MaybeWithData<Paginator<T> | SimplePaginator<T> | CursorPaginator<T>>>(paginator: P, options?: Omit<index_d_exports.HybridRequestOptions, 'method' | 'url'>): PaginatorResult<T, P>;
480
+ declare function createPaginator<T, P extends MaybeWithData<Paginator<T> | SimplePaginator<T> | CursorPaginator<T>>>(paginator: P, defaultOptions?: Omit<index_d_exports.HybridRequestOptions, 'method' | 'url'>): PaginatorResult<T, P>;
207
481
  //#endregion
208
- //#region src/composables/register-hook.d.ts
482
+ //#region src/composables/property.d.ts
483
+ type Property = string | number | boolean | Property[] | {
484
+ [name: string]: Property;
485
+ };
486
+ type InternalProperties = GlobalHybridlyProperties & {
487
+ [key: string]: Property;
488
+ };
489
+ /** Accesses all current properties. */
490
+ declare function useProperties<T extends object, Global extends InternalProperties = InternalProperties>(): vue.DeepReadonly<vue.UnwrapNestedRefs<T & Global>>;
491
+ /** Accesses a property with a dot notation. */
492
+ declare function useProperty<Override = never, T extends SearchableObject = GlobalHybridlyProperties, P extends Path<T> & string = Path<T> & string, ReturnType = ([Override] extends [never] ? PathValue<T, P> : Override)>(path: [Override] extends [never] ? P : string): ComputedRef<ReturnType>;
209
493
  /**
210
- * Registers a global hook.
211
- * If called inside a component, unregisters after the component is unmounted.
494
+ * Sets the property at the given path to the given value.
495
+ * Note: this helper is experimental and may change in the future.
212
496
  */
213
- declare const registerHook: typeof registerHook$1;
497
+ declare function setProperty<Override = never, T extends SearchableObject = GlobalHybridlyProperties, P extends Path<T> & string = Path<T> & string, ValueType = ([Override] extends [never] ? PathValue<T, P> : Override)>(path: [Override] extends [never] ? P : string, value: ValueType): void;
214
498
  //#endregion
215
- //#region ../core/src/router/types.d.ts
216
- type Property = null | string | number | boolean | Property[] | {
217
- [name: string]: Property;
218
- };
219
- type Properties = Record<string | number, Property>;
499
+ //#region src/composables/query-parameters.d.ts
500
+ /**
501
+ * Access reactive query parameters.
502
+ *
503
+ * @see https://hybridly.dev/api/utils/use-query-parameters.html
504
+ */
505
+ declare function useQueryParameters<T extends Record<string, any> = Record<string, any>>(): T;
506
+ type RouteParameter = string | number | boolean | null | undefined;
507
+ type TransformFunction<V extends RouteParameter, R> = (val: V) => R;
508
+ type TransformType<T extends RouteParameter, O> = O extends {
509
+ transform: 'number';
510
+ } ? number : O extends {
511
+ transform: 'bool';
512
+ } ? boolean : O extends {
513
+ transform: 'string';
514
+ } ? string : O extends {
515
+ transform: 'date';
516
+ } ? Date : O extends {
517
+ transform: TransformFunction<T, infer R>;
518
+ } ? R : T;
519
+ interface UseQueryParameterOptions<V extends RouteParameter, R> {
520
+ /**
521
+ * Specifies a default value if the query parameter does not exist.
522
+ */
523
+ defaultValue?: MaybeRefOrGetter<R>;
524
+ /**
525
+ * Transforms the query parameter.
526
+ */
527
+ transform?: 'number' | 'bool' | 'string' | 'date' | TransformFunction<V, R>;
528
+ }
529
+ /**
530
+ * Makes the specified query parameter reactive.
531
+ *
532
+ * @see https://hybridly.dev/api/utils/use-query-parameter.html
533
+ */
534
+ declare function useQueryParameter<ParameterType extends RouteParameter = RouteParameter, Options extends UseQueryParameterOptions<ParameterType, any> = UseQueryParameterOptions<ParameterType, ParameterType>>(name: string, options?: Options): Ref<TransformType<ParameterType, Options>>;
220
535
  //#endregion
221
- //#region src/composables/dialog.d.ts
536
+ //#region src/composables/refinements.d.ts
537
+ type SortDirection = 'asc' | 'desc';
538
+ type AvailableHybridRequestOptions = Omit<HybridRequestOptions, 'url' | 'data'>;
539
+ type AvailableHybridRequestOptionsForFilters = AvailableHybridRequestOptions & {
540
+ operator?: FilterOperator;
541
+ options?: {
542
+ /**
543
+ * Show empty relationships in relationship filters.
544
+ */
545
+ empty?: boolean;
546
+ [key: string]: any;
547
+ };
548
+ };
549
+ type FilterOperator = 'equals' | 'not_equals' | 'in' | 'not_in' | 'is_null' | 'is_not_null' | 'contains' | 'not_contains' | 'begins_with' | 'ends_with' | 'is_empty' | 'is_not_empty' | 'greater_than' | 'greater_than_or_equal' | 'less_than' | 'less_than_or_equal' | 'between' | 'not_between' | 'after' | 'before' | 'in_the_last' | 'not_in_the_last';
550
+ interface ToggleSortOptions extends AvailableHybridRequestOptions {
551
+ direction?: SortDirection;
552
+ /** Additional sort data, only applied when sorting. */
553
+ sortData?: {
554
+ [key: string]: FormDataConvertible;
555
+ };
556
+ }
557
+ interface BindFilterOptions<T> extends AvailableHybridRequestOptions {
558
+ transformValue?: (value?: T) => any;
559
+ /** If specified, this callback will be responsible for watching the specified ref that contains the filter value. */
560
+ watch?: (ref: Ref<T>, cb: any) => void;
561
+ /**
562
+ * The debounce time in milliseconds for applying this filter.
563
+ * @default 250ms
564
+ */
565
+ debounce?: number;
566
+ /**
567
+ * The debounce time in milliseconds for updating the ref.
568
+ * @default 250ms
569
+ */
570
+ syncDebounce?: number;
571
+ }
572
+ /**
573
+ * Base interface for all filter refinements.
574
+ */
575
+ interface BaseFilterRefinement {
576
+ /**
577
+ * Whether this filter is currently active.
578
+ */
579
+ is_active: boolean;
580
+ /**
581
+ * A string-based icon identifier.
582
+ */
583
+ icon?: string;
584
+ /**
585
+ * The type of this filter.
586
+ */
587
+ type: string;
588
+ /**
589
+ * The label of the filter.
590
+ */
591
+ label: string;
592
+ /**
593
+ * The name of the filter.
594
+ */
595
+ name: string;
596
+ /**
597
+ * The current value of the filter.
598
+ */
599
+ value: any;
600
+ /**
601
+ * The current search query of the filter.
602
+ */
603
+ search_query?: string;
604
+ /**
605
+ * The current options of the filter.
606
+ */
607
+ options?: Record<string, any>;
608
+ /**
609
+ * Whether this filter is hidden.
610
+ */
611
+ hidden: boolean;
612
+ /**
613
+ * The default value of the filter.
614
+ */
615
+ default: any;
616
+ /**
617
+ * Whether this filter has an explicitly configured default value.
618
+ */
619
+ has_default: boolean;
620
+ /**
621
+ * The current operator of the filter.
622
+ */
623
+ operator?: FilterOperator;
624
+ /**
625
+ * The default operator of the filter.
626
+ */
627
+ default_operator?: FilterOperator;
628
+ /**
629
+ * The list of supported operators for this filter.
630
+ */
631
+ supported_operators?: FilterOperator[];
632
+ /**
633
+ * The metadata attributes of the filter.
634
+ */
635
+ metadata: {
636
+ /**
637
+ * A string-based icon identifier.
638
+ */
639
+ icon?: string;
640
+ /**
641
+ * The label of the filter, suitable for display purposes.
642
+ */
643
+ label?: string;
644
+ /**
645
+ * A label suitable for previewing this filter in a compact context, like a pill.
646
+ */
647
+ preview_label?: string;
648
+ /**
649
+ * A string-based identifier suitable for previewing this filter in a compact context, like a pill.
650
+ */
651
+ current_value_label?: string;
652
+ /**
653
+ * A string-based icon identifier suitable for displaying next to the current value of this filter in a compact context, like a pill.
654
+ */
655
+ current_value_icon?: string;
656
+ /**
657
+ * A custom property.
658
+ */
659
+ [key: string]: any;
660
+ };
661
+ }
662
+ /**
663
+ * Text filter refinement.
664
+ */
665
+ interface TextFilterRefinement extends BaseFilterRefinement {
666
+ type: 'text';
667
+ operator?: FilterOperator;
668
+ }
669
+ /**
670
+ * Select filter refinement.
671
+ */
672
+ interface SelectFilterRefinement extends BaseFilterRefinement {
673
+ type: 'select';
674
+ operator?: FilterOperator;
675
+ metadata: BaseFilterRefinement['metadata'] & {
676
+ /**
677
+ * Whether multiple options can be selected.
678
+ */
679
+ is_multiple?: boolean;
680
+ /**
681
+ * Whether the select filter is searchable.
682
+ */
683
+ is_searchable?: boolean;
684
+ /**
685
+ * Available options for the select filter.
686
+ */
687
+ options?: Record<string | number, string>;
688
+ /**
689
+ * Label for the selected options.
690
+ */
691
+ selected_options_label?: string;
692
+ /**
693
+ * Whether the filter allows an empty relationship option.
694
+ */
695
+ allows_empty_relationship_option?: boolean;
696
+ /**
697
+ * Label for the empty relationship option.
698
+ */
699
+ empty_relationship_option_label?: string;
700
+ /**
701
+ * Label for the empty search result.
702
+ */
703
+ empty_search_result_label?: string;
704
+ };
705
+ }
706
+ /**
707
+ * Ternary filter refinement.
708
+ */
709
+ interface TernaryFilterRefinement extends BaseFilterRefinement {
710
+ type: 'ternary';
711
+ operator?: FilterOperator;
712
+ metadata: BaseFilterRefinement['metadata'] & {
713
+ /**
714
+ * Label for the true state.
715
+ */
716
+ true_label?: string;
717
+ /**
718
+ * Label for the false state.
719
+ */
720
+ false_label?: string;
721
+ /**
722
+ * Placeholder label.
723
+ */
724
+ placeholder?: string;
725
+ };
726
+ supported_operators?: never;
727
+ }
728
+ /**
729
+ * Boolean filter refinement.
730
+ */
731
+ interface BooleanFilterRefinement extends BaseFilterRefinement {
732
+ type: 'boolean';
733
+ operator?: FilterOperator;
734
+ metadata: BaseFilterRefinement['metadata'] & {
735
+ /**
736
+ * Label for the true state.
737
+ */
738
+ true_label?: string;
739
+ /**
740
+ * Label for the false state.
741
+ */
742
+ false_label?: string;
743
+ };
744
+ }
745
+ /**
746
+ * Numeric filter refinement.
747
+ */
748
+ interface NumericFilterRefinement extends BaseFilterRefinement {
749
+ type: 'numeric';
750
+ operator?: FilterOperator;
751
+ }
752
+ /**
753
+ * Time suggestion for single date filters.
754
+ */
755
+ interface TimeSuggestion {
756
+ type: 'time';
757
+ label: string;
758
+ date: string;
759
+ is_current: boolean;
760
+ }
761
+ /**
762
+ * Timeframe suggestion for date range filters.
763
+ */
764
+ interface TimeframeSuggestion {
765
+ type: 'timeframe';
766
+ label: string;
767
+ start: string;
768
+ end: string;
769
+ is_current: boolean;
770
+ }
771
+ /**
772
+ * Date filter refinement.
773
+ */
774
+ interface DateFilterRefinement extends BaseFilterRefinement {
775
+ type: 'date';
776
+ operator?: FilterOperator;
777
+ metadata: BaseFilterRefinement['metadata'] & {
778
+ /**
779
+ * Whether this is a timeframe filter (with start and end columns).
780
+ */
781
+ is_timeframe?: boolean;
782
+ /**
783
+ * The start column for timeframe filters.
784
+ */
785
+ start_column?: string;
786
+ /**
787
+ * The end column for timeframe filters.
788
+ */
789
+ end_column?: string;
790
+ /**
791
+ * Suggested dates or timeframes for this filter.
792
+ */
793
+ suggestions?: Array<TimeSuggestion | TimeframeSuggestion>;
794
+ /**
795
+ * A description for this filter, suitable for display purposes.
796
+ */
797
+ description?: string;
798
+ };
799
+ }
800
+ /**
801
+ * Trashed filter refinement.
802
+ */
803
+ interface TrashedFilterRefinement extends BaseFilterRefinement {
804
+ type: 'trashed';
805
+ supported_operators?: never;
806
+ }
807
+ /**
808
+ * Callback filter refinement.
809
+ */
810
+ interface CallbackFilterRefinement extends BaseFilterRefinement {
811
+ type: 'callback' | (string & {});
812
+ supported_operators?: never;
813
+ }
814
+ /**
815
+ * Represents a filter.
816
+ */
817
+ type FilterRefinement = TextFilterRefinement | SelectFilterRefinement | TernaryFilterRefinement | BooleanFilterRefinement | NumericFilterRefinement | DateFilterRefinement | TrashedFilterRefinement | CallbackFilterRefinement;
818
+ interface SortRefinement {
819
+ /**
820
+ * Whether this sort is currently active.
821
+ */
822
+ is_active: boolean;
823
+ /**
824
+ * The current direction of the sort.
825
+ */
826
+ direction?: SortDirection;
827
+ /**
828
+ * The default direction of the sort.
829
+ */
830
+ default?: SortDirection;
831
+ /**
832
+ * Whether this sort has an explicitly configured default direction.
833
+ */
834
+ has_default: boolean;
835
+ /**
836
+ * The label of the sort.
837
+ */
838
+ label: string;
839
+ /**
840
+ * The metadata attributes of the sort.
841
+ */
842
+ metadata: Record<string, any>;
843
+ /**
844
+ * The name of the sort.
845
+ */
846
+ name: string;
847
+ /**
848
+ * The value corresponding to the descending sort.
849
+ */
850
+ desc: string;
851
+ /**
852
+ * The value corresponding to the ascending sort.
853
+ */
854
+ asc: string;
855
+ /**
856
+ * The value that will be applied on toggle.
857
+ */
858
+ next: string;
859
+ /**
860
+ * Whether this sort is hidden.
861
+ */
862
+ hidden: boolean;
863
+ }
864
+ interface Refinements {
865
+ /**
866
+ * The list of available filters.
867
+ */
868
+ filters: Array<FilterRefinement>;
869
+ /**
870
+ * The list of available sorts.
871
+ */
872
+ sorts: Array<SortRefinement>;
873
+ /**
874
+ * The URL scope for these refinements.
875
+ */
876
+ scope?: string;
877
+ /**
878
+ * The scope keys for these refinements.
879
+ */
880
+ keys: {
881
+ /**
882
+ * The scope key for sorting.
883
+ */
884
+ sorts: string;
885
+ /**
886
+ * The scope key for filtering.
887
+ */
888
+ filters: string;
889
+ };
890
+ }
891
+ /**
892
+ * Base bound filter refinement with common methods.
893
+ */
894
+ interface BoundFilterRefinementMethods {
895
+ /**
896
+ * Applies this filter.
897
+ */
898
+ apply: (value: any, options?: AvailableHybridRequestOptionsForFilters) => Promise<NavigationResponse | undefined>;
899
+ /**
900
+ * Clears this filter.
901
+ */
902
+ clear: (options?: AvailableHybridRequestOptions) => Promise<NavigationResponse>;
903
+ /**
904
+ * Searches this filter.
905
+ */
906
+ search: (value?: string | number, options?: AvailableHybridRequestOptions) => Promise<NavigationResponse | undefined>;
907
+ /**
908
+ * Whether this filter is a date filter.
909
+ */
910
+ isDateFilter: () => boolean;
911
+ /**
912
+ * Whether this filter is a select filter.
913
+ */
914
+ isSelectFilter: () => boolean;
915
+ /**
916
+ * Whether this filter is a search filter.
917
+ */
918
+ isSearchFilter: () => boolean;
919
+ /**
920
+ * Whether this filter is a ternary filter.
921
+ */
922
+ isTernaryFilter: () => boolean;
923
+ /**
924
+ * Whether this filter is a boolean filter.
925
+ */
926
+ isBooleanFilter: () => boolean;
927
+ /**
928
+ * Whether this filter is a trashed filter.
929
+ */
930
+ isTrashedFilter: () => boolean;
931
+ /**
932
+ * Whether this filter is a callback filter.
933
+ */
934
+ isCallbackFilter: () => boolean;
935
+ }
936
+ /**
937
+ * Checks whether the given filter is a text filter, and narrows its type.
938
+ */
939
+ declare function isTextFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundTextFilterRefinement;
940
+ /**
941
+ * Checks whether the given filter is a date filter, and narrows its type.
942
+ */
943
+ declare function isDateFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundDateFilterRefinement;
944
+ /**
945
+ * Checks whether the given filter is a select filter, and narrows its type.
946
+ */
947
+ declare function isSelectFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundSelectFilterRefinement;
948
+ /**
949
+ * Checks whether the given filter is a ternary filter, and narrows its type.
950
+ */
951
+ declare function isTernaryFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundTernaryFilterRefinement;
952
+ /**
953
+ * Checks whether the given filter is a boolean filter, and narrows its type.
954
+ */
955
+ declare function isBooleanFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundBooleanFilterRefinement;
956
+ /**
957
+ * Checks whether the given filter is a trashed filter, and narrows its type.
958
+ */
959
+ declare function isTrashedFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundTrashedFilterRefinement;
960
+ /**
961
+ * Checks whether the given filter is a callback filter, and narrows its type.
962
+ */
963
+ declare function isCallbackFilter(filter: FilterRefinement | BoundFilterRefinement): filter is BoundCallbackFilterRefinement;
964
+ /**
965
+ * Bound text filter refinement with type-specific methods.
966
+ */
967
+ interface BoundTextFilterRefinement extends TextFilterRefinement, BoundFilterRefinementMethods {}
968
+ /**
969
+ * Bound date filter refinement with type-specific methods.
970
+ */
971
+ interface BoundDateFilterRefinement extends DateFilterRefinement, BoundFilterRefinementMethods {}
972
+ /**
973
+ * Bound select filter refinement with type-specific methods.
974
+ */
975
+ interface BoundSelectFilterRefinement extends SelectFilterRefinement, BoundFilterRefinementMethods {}
976
+ /**
977
+ * Bound ternary filter refinement with type-specific methods.
978
+ */
979
+ interface BoundTernaryFilterRefinement extends TernaryFilterRefinement, BoundFilterRefinementMethods {}
980
+ /**
981
+ * Bound boolean filter refinement with type-specific methods.
982
+ */
983
+ interface BoundBooleanFilterRefinement extends BooleanFilterRefinement, BoundFilterRefinementMethods {}
984
+ /**
985
+ * Bound trashed filter refinement with type-specific methods.
986
+ */
987
+ interface BoundTrashedFilterRefinement extends TrashedFilterRefinement, BoundFilterRefinementMethods {}
222
988
  /**
223
- * Exposes utilities related to the dialogs.
989
+ * Bound callback filter refinement with type-specific methods.
224
990
  */
225
- declare function useDialog(): {
226
- /** Closes the dialog. */close: () => void; /** Closes the dialog without a server round-trip. */
227
- closeLocally: () => void; /** Unmounts the dialog. Should be called after its closing animations. */
228
- unmount: () => void; /** Whether the dialog is shown. */
229
- show: vue0.WritableComputedRef<boolean | undefined, boolean | undefined>; /** Properties of the dialog. */
230
- properties: vue0.ComputedRef<Properties | undefined>;
231
- };
232
- //#endregion
233
- //#region src/composables/refinements.d.ts
234
- type SortDirection = 'asc' | 'desc';
235
- type AvailableHybridRequestOptions = Omit<HybridRequestOptions, 'url' | 'data'>;
236
- interface ToggleSortOptions extends AvailableHybridRequestOptions {
237
- direction?: SortDirection;
238
- /** Additional sort data, only applied when sorting. */
239
- sortData?: {
240
- [key: string]: FormDataConvertible;
241
- };
242
- }
243
- interface BindFilterOptions<T> extends AvailableHybridRequestOptions {
244
- transformValue?: (value?: T) => any;
245
- /** If specified, this callback will be responsible for watching the specified ref that contains the filter value. */
246
- watch?: (ref: Ref<T>, cb: any) => void;
991
+ interface BoundCallbackFilterRefinement extends CallbackFilterRefinement, BoundFilterRefinementMethods {}
992
+ /**
993
+ * Union of all bound filter refinement types.
994
+ */
995
+ type BoundFilterRefinement = BoundTextFilterRefinement | BoundSelectFilterRefinement | BoundTernaryFilterRefinement | BoundBooleanFilterRefinement | BoundTrashedFilterRefinement | BoundCallbackFilterRefinement;
996
+ interface BoundSortRefinement extends SortRefinement {
247
997
  /**
248
- * The debounce time in milliseconds for applying this filter.
249
- * @default 250ms
998
+ * Toggles this sort.
250
999
  */
251
- debounce?: number;
1000
+ toggle: (options?: ToggleSortOptions) => Promise<NavigationResponse | undefined>;
252
1001
  /**
253
- * The debounce time in milliseconds for updating the ref.
254
- * @default 250ms
1002
+ * Checks if this sort is active.
255
1003
  */
256
- syncDebounce?: number;
257
- }
258
- declare global {
259
- interface FilterRefinement {
260
- /**
261
- * Whether this filter is currently active.
262
- */
263
- is_active: boolean;
264
- /**
265
- * The type of this filter.
266
- */
267
- type: 'trashed' | 'callback' | 'exact' | 'similar:loose' | 'similar:begins_with_strict' | 'similar:ends_with_strict' | string;
268
- /**
269
- * The label of the filter.
270
- */
271
- label: string;
272
- /**
273
- * The metadata attributes of the filter.
274
- */
275
- metadata: Record<string, any>;
276
- /**
277
- * The name of the fitler.
278
- */
279
- name: string;
280
- /**
281
- * The current value of the filter.
282
- */
283
- value: any;
284
- /**
285
- * Whether this filter is hidden.
286
- */
287
- hidden: boolean;
288
- /**
289
- * The default value of the filter.
290
- */
291
- default: any;
292
- }
293
- interface SortRefinement {
294
- /**
295
- * Whether this sort is currently active.
296
- */
297
- is_active: boolean;
298
- /**
299
- * The current direction of the sort.
300
- */
301
- direction?: SortDirection;
302
- /**
303
- * The default direction of the sort.
304
- */
305
- default?: SortDirection;
306
- /**
307
- * The label of the sort.
308
- */
309
- label: string;
310
- /**
311
- * The metadata attributes of the sort.
312
- */
313
- metadata: Record<string, any>;
314
- /**
315
- * The name of the sort.
316
- */
317
- name: string;
318
- /**
319
- * The value corresponding to the descending sort.
320
- */
321
- desc: string;
322
- /**
323
- * The value corresponding to the ascending sort.
324
- */
325
- asc: string;
326
- /**
327
- * The value that will be applied on toggle.
328
- */
329
- next: string;
330
- /**
331
- * Whether this sort is hidden.
332
- */
333
- hidden: boolean;
334
- }
335
- interface Refinements {
336
- /**
337
- * The list of available filters.
338
- */
339
- filters: Array<FilterRefinement>;
340
- /**
341
- * The list of available sorts.
342
- */
343
- sorts: Array<SortRefinement>;
344
- /**
345
- * The URL scope for these refinements.
346
- */
347
- scope?: string;
348
- /**
349
- * The scope keys for these refinements.
350
- */
351
- keys: {
352
- /**
353
- * The scope key for sorting.
354
- */
355
- sorts: string;
356
- /**
357
- * The scope key for filtering.
358
- */
359
- filters: string;
360
- };
361
- }
1004
+ isSorting: (direction?: SortDirection) => boolean;
1005
+ /**
1006
+ * Clears this sort.
1007
+ */
1008
+ clear: (options?: AvailableHybridRequestOptions) => Promise<NavigationResponse>;
362
1009
  }
363
- declare function useRefinements<Properties extends object, RefinementsKey extends { [K in keyof Properties]: Properties[K] extends Refinements ? K : never }[keyof Properties]>(properties: Properties, refinementsKeys: RefinementsKey, defaultOptions?: AvailableHybridRequestOptions): {
1010
+ interface UseRefinements {
364
1011
  /**
365
1012
  * Binds a named filter to a ref, applying filters when it changes and updating the ref accordingly.
366
1013
  */
367
- bindFilter: <T = string | number>(name: string, options?: BindFilterOptions<T>) => Ref<T>;
1014
+ bindFilter: <T = string | number>(name: string, options?: BindFilterOptions<T>) => Ref<string>;
368
1015
  /**
369
1016
  * Available filters.
370
1017
  */
371
- filters: {
372
- /**
373
- * Applies this filter.
374
- */
375
- apply: (value: any, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
376
- /**
377
- * Clears this filter.
378
- */
379
- clear: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
380
- /**
381
- * Whether this filter is currently active.
382
- */
383
- is_active: boolean;
384
- /**
385
- * The type of this filter.
386
- */
387
- type: "trashed" | "callback" | "exact" | "similar:loose" | "similar:begins_with_strict" | "similar:ends_with_strict" | string;
388
- /**
389
- * The label of the filter.
390
- */
391
- label: string;
392
- /**
393
- * The metadata attributes of the filter.
394
- */
395
- metadata: Record<string, any>;
396
- /**
397
- * The name of the fitler.
398
- */
399
- name: string;
400
- /**
401
- * The current value of the filter.
402
- */
403
- value: any;
404
- /**
405
- * Whether this filter is hidden.
406
- */
407
- hidden: boolean;
408
- /**
409
- * The default value of the filter.
410
- */
411
- default: any;
412
- }[];
1018
+ filters: ComputedRef<Array<BoundFilterRefinement>>;
413
1019
  /**
414
1020
  * Available sorts.
415
1021
  */
416
- sorts: {
417
- /**
418
- * Toggles this sort.
419
- */
420
- toggle: (options?: ToggleSortOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
421
- /**
422
- * Checks if this sort is active.
423
- */
424
- isSorting: (direction?: SortDirection) => boolean;
425
- /**
426
- * Clears this sort.
427
- */
428
- clear: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
429
- /**
430
- * Whether this sort is currently active.
431
- */
432
- is_active: boolean;
433
- /**
434
- * The current direction of the sort.
435
- */
436
- direction?: SortDirection;
437
- /**
438
- * The default direction of the sort.
439
- */
440
- default?: SortDirection;
441
- /**
442
- * The label of the sort.
443
- */
444
- label: string;
445
- /**
446
- * The metadata attributes of the sort.
447
- */
448
- metadata: Record<string, any>;
449
- /**
450
- * The name of the sort.
451
- */
452
- name: string;
453
- /**
454
- * The value corresponding to the descending sort.
455
- */
456
- desc: string;
457
- /**
458
- * The value corresponding to the ascending sort.
459
- */
460
- asc: string;
461
- /**
462
- * The value that will be applied on toggle.
463
- */
464
- next: string;
465
- /**
466
- * Whether this sort is hidden.
467
- */
468
- hidden: boolean;
469
- }[];
1022
+ sorts: ComputedRef<Array<BoundSortRefinement>>;
470
1023
  /**
471
1024
  * The key for the filters.
472
1025
  */
473
- filtersKey: vue0.ComputedRef<string>;
1026
+ filtersKey: Readonly<Ref<string>>;
1027
+ /**
1028
+ * The key for the sorts.
1029
+ */
1030
+ sortsKey: Readonly<Ref<string>>;
474
1031
  /**
475
1032
  * Gets a filter by name.
476
1033
  */
477
- getFilter: (name: string) => FilterRefinement | undefined;
1034
+ getFilter: (name: string) => BoundFilterRefinement | undefined;
478
1035
  /**
479
1036
  * Gets a sort by name.
480
1037
  */
481
- getSort: (name: string) => SortRefinement | undefined;
1038
+ getSort: (name: string) => BoundSortRefinement | undefined;
482
1039
  /**
483
1040
  * Resets all filters and sorts.
484
1041
  */
485
- reset: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
1042
+ reset: (options?: AvailableHybridRequestOptions) => Promise<NavigationResponse>;
486
1043
  /**
487
1044
  * Toggles the specified sort.
488
1045
  */
489
- toggleSort: (name: string, options?: ToggleSortOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
1046
+ toggleSort: (name: string, options?: ToggleSortOptions) => Promise<NavigationResponse | undefined>;
490
1047
  /**
491
1048
  * Whether a sort is active.
492
1049
  */
@@ -506,67 +1063,42 @@ declare function useRefinements<Properties extends object, RefinementsKey extend
506
1063
  /**
507
1064
  * Clears the given filter.
508
1065
  */
509
- clearFilter: (filter: string, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
1066
+ clearFilter: (filter: string, options?: AvailableHybridRequestOptions) => Promise<NavigationResponse>;
510
1067
  /**
511
1068
  * Resets all sorts.
512
1069
  */
513
- clearSorts: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
1070
+ clearSorts: (options?: AvailableHybridRequestOptions) => Promise<NavigationResponse>;
514
1071
  /**
515
1072
  * Resets all filters.
516
1073
  */
517
- clearFilters: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
1074
+ clearFilters: (options?: AvailableHybridRequestOptions) => Promise<NavigationResponse>;
518
1075
  /**
519
1076
  * Applies the given filter.
520
1077
  */
521
- applyFilter: (name: string, value: any, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
522
- };
523
- //#endregion
524
- //#region src/composables/current-route.d.ts
525
- declare function useRoute(): {
526
- isNavigating: Readonly<vue0.Ref<boolean, boolean>>;
527
- current: Readonly<vue0.Ref<string | undefined, string | undefined>>;
528
- matches: <T extends RouteName>(name: MaybeRefOrGetter<T>, parameters?: RouteParameters<T>) => boolean;
529
- };
530
- //#endregion
531
- //#region src/composables/bulk-select.d.ts
532
- interface BulkSelection<T = any> {
533
- /** Whether all records are selected. */
534
- all: boolean;
535
- /** Included records. */
536
- only: Set<T>;
537
- /** Excluded records. */
538
- except: Set<T>;
1078
+ applyFilter: (name: string, value: any, options?: AvailableHybridRequestOptionsForFilters) => Promise<NavigationResponse | undefined>;
539
1079
  }
540
- declare function useBulkSelect<T = any>(): {
541
- allSelected: vue0.ComputedRef<boolean>;
542
- selectAll: () => void;
543
- deselectAll: () => void;
544
- select: (...records: T[]) => void;
545
- deselect: (...records: T[]) => void;
546
- toggle: (record: T, force?: boolean) => void;
547
- selected: (record: T) => boolean;
548
- selection: Ref<BulkSelection<T>, BulkSelection<T>>;
549
- bindCheckbox: (key: T) => {
550
- onChange: (event: Event) => void;
551
- checked: boolean;
552
- value: T;
553
- };
554
- };
1080
+ declare function useRefinements<T extends Refinements>(input: MaybeRefOrGetter<T>, defaultOptions?: AvailableHybridRequestOptions): UseRefinements;
1081
+ //#endregion
1082
+ //#region src/composables/register-hook.d.ts
1083
+ /**
1084
+ * Registers a global hook.
1085
+ * If called inside a component, unregisters after the component is unmounted.
1086
+ */
1087
+ declare const registerHook: typeof registerHook$1;
555
1088
  //#endregion
556
1089
  //#region src/composables/table.d.ts
557
- declare global {
558
- interface Table<T extends Record<string, any> = any, PaginatorKind extends 'cursor' | 'length-aware' | 'simple' = 'length-aware'> {
559
- id: string;
560
- keyName: string;
561
- scope?: string;
562
- columns: Column<T>[];
563
- inlineActions: InlineAction[];
564
- bulkActions: BulkAction[];
565
- records: Array<T>;
566
- paginator: Omit<PaginatorKind extends 'cursor' ? CursorPaginator<T> : (PaginatorKind extends 'simple' ? SimplePaginator<T> : Paginator<T>), 'data'>;
567
- refinements: Refinements;
568
- endpoint: string;
569
- }
1090
+ interface Table<T extends Record<string, any> = any, PaginatorKind extends 'cursor' | 'length-aware' | 'simple' = 'length-aware'> {
1091
+ id: string;
1092
+ keyName: keyof T | null;
1093
+ scope?: string;
1094
+ columns: Column<T>[];
1095
+ inlineActions: InlineAction[];
1096
+ bulkActions: BulkAction[];
1097
+ records: Array<T>;
1098
+ cells: TableCellRow<T>[];
1099
+ paginator: Omit<PaginatorKind extends 'cursor' ? CursorPaginator<T> : (PaginatorKind extends 'simple' ? SimplePaginator<T> : Paginator<T>), 'data'>;
1100
+ refinements: Refinements;
1101
+ endpoint: string;
570
1102
  }
571
1103
  interface Column<T extends object = never> {
572
1104
  /** The name of this column. */
@@ -578,6 +1110,14 @@ interface Column<T extends object = never> {
578
1110
  /** Metadata of this column. */
579
1111
  metadata: Record<string, any>;
580
1112
  }
1113
+ interface TableCell<T extends object = never> {
1114
+ value: any;
1115
+ extra: Record<string, any>;
1116
+ }
1117
+ interface TableCellRow<T extends object = never> {
1118
+ key: RecordIdentifier | null;
1119
+ columns: Partial<Record<keyof T | string, TableCell<T>>>;
1120
+ }
581
1121
  interface Action {
582
1122
  /** The name of this action. */
583
1123
  name: string;
@@ -587,21 +1127,19 @@ interface Action {
587
1127
  type: string;
588
1128
  /** Custom metadata for this action. */
589
1129
  metadata: any;
1130
+ /** A user-defined URL to which to post the action. */
1131
+ url?: string;
590
1132
  }
591
1133
  interface BulkAction extends Action {
592
1134
  /** Should deselect all records after action. */
593
1135
  deselect: boolean;
594
1136
  }
595
- interface BulkActionOptions {
1137
+ interface BulkActionOptions extends Omit<HybridRequestOptions, 'url'> {
596
1138
  /** Force deselecting all records after action. */
597
1139
  deselect?: boolean;
598
1140
  }
599
1141
  interface InlineAction extends Action {}
600
1142
  type RecordIdentifier = string | number;
601
- type AsRecordTypeWithExtra<T extends Record<string, any>> = { [K in keyof T]: {
602
- extra: Record<string, any>;
603
- value: T[K];
604
- } };
605
1143
  interface TableDefaultOptions extends AvailableHybridRequestOptions {
606
1144
  /**
607
1145
  * Whether to include existing query parameters in the request.
@@ -613,154 +1151,165 @@ interface TableDefaultOptions extends AvailableHybridRequestOptions {
613
1151
  */
614
1152
  data?: Record<string, FormDataConvertible> | FormDataConvertible;
615
1153
  }
616
- /**
617
- * Provides utilities for working with tables.
618
- */
619
- declare function useTable<RecordType extends (Props[PropsKey] extends Table<infer T, any> ? T : never), RecordTypeWithExtra extends AsRecordTypeWithExtra<RecordType>, PaginatorKindName extends (Props[PropsKey] extends Table<any, infer PaginatorKind> ? PaginatorKind : never), TableType extends (Props[PropsKey] extends Table<any, PaginatorKindName> ? Table<RecordTypeWithExtra, PaginatorKindName> : never), Props extends Record<string, unknown>, PropsKey extends keyof Props>(props: Props, key: PropsKey, defaultOptions?: TableDefaultOptions): {
620
- bindFilter: <T = string | number>(name: string, options?: BindFilterOptions<T>) => vue0.Ref<T, T>;
621
- filters: {
622
- apply: (value: any, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
623
- clear: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
624
- is_active: boolean;
625
- type: "trashed" | "callback" | "exact" | "similar:loose" | "similar:begins_with_strict" | "similar:ends_with_strict" | string;
626
- label: string;
627
- metadata: Record<string, any>;
628
- name: string;
629
- value: any;
630
- hidden: boolean;
631
- default: any;
632
- }[];
633
- sorts: {
634
- toggle: (options?: ToggleSortOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
635
- isSorting: (direction?: SortDirection) => boolean;
636
- clear: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
637
- is_active: boolean;
638
- direction?: SortDirection | undefined;
639
- default?: SortDirection | undefined;
640
- label: string;
641
- metadata: Record<string, any>;
642
- name: string;
643
- desc: string;
644
- asc: string;
645
- next: string;
646
- hidden: boolean;
647
- }[];
648
- filtersKey: string;
649
- getFilter: (name: string) => FilterRefinement | undefined;
650
- getSort: (name: string) => SortRefinement | undefined;
651
- reset: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
652
- toggleSort: (name: string, options?: ToggleSortOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
653
- isSorting: (name?: string, direction?: SortDirection) => boolean;
654
- isFiltering: (name?: string) => boolean;
655
- currentSorts: () => Array<SortRefinement>;
656
- currentFilters: () => Array<FilterRefinement>;
657
- clearFilter: (filter: string, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
658
- clearSorts: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
659
- clearFilters: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>;
660
- applyFilter: (name: string, value: any, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse | undefined>;
1154
+ type UseTableNavigationResponse = Promise<_hybridly_core0.NavigationResponse | undefined>;
1155
+ type ExtractRefValue<T> = T extends {
1156
+ value: infer Value;
1157
+ } ? Value : T;
1158
+ interface UseTableInlineActionItem<RecordType extends Record<string, any>> extends InlineAction {
1159
+ /** Executes the action. */
1160
+ execute: (record: RecordIdentifier | RecordType) => UseTableNavigationResponse;
1161
+ }
1162
+ interface UseTableBulkActionItem extends BulkAction {
1163
+ /** Executes the action. */
1164
+ execute: (options?: BulkActionOptions) => UseTableNavigationResponse;
1165
+ }
1166
+ interface UseTableColumn<RecordType extends Record<string, any>> extends Column<RecordType> {
1167
+ /** Toggles sorting for this column. */
1168
+ toggleSort: (options?: ToggleSortOptions) => UseTableNavigationResponse;
1169
+ /** Checks whether the column is being sorted. */
1170
+ isSorting: (direction?: SortDirection) => boolean;
1171
+ /** Applies the filter for this column. */
1172
+ applyFilter: (value: any, options?: AvailableHybridRequestOptions) => UseTableNavigationResponse;
1173
+ /** Clears the filter for this column. */
1174
+ clearFilter: (options?: AvailableHybridRequestOptions) => UseTableNavigationResponse;
1175
+ /** Checks whether the column is sortable. */
1176
+ isSortable: boolean;
1177
+ /** Checks whether the column is filterable. */
1178
+ isFilterable: boolean;
1179
+ }
1180
+ interface UseTableRecordItem<RecordType extends Record<string, any>> {
1181
+ /** The actual record. */
1182
+ record: RecordType;
1183
+ /** Local key of the record. Use this as a rendering key. */
1184
+ key: RecordIdentifier;
1185
+ /** Server-side key of the record, if any. */
1186
+ recordKey: RecordIdentifier | undefined;
1187
+ /** Whether this record has a server-side key. */
1188
+ hasKey: boolean;
1189
+ /** Executes the given inline action. */
1190
+ execute: (action: string | InlineAction) => UseTableNavigationResponse;
1191
+ /** Gets the available inline actions. */
1192
+ actions: Array<InlineAction & {
1193
+ execute: () => UseTableNavigationResponse;
1194
+ }>;
1195
+ /** Selects this record. */
1196
+ select: () => void;
1197
+ /** Deselects this record. */
1198
+ deselect: () => void;
1199
+ /** Toggles the selection for this record. */
1200
+ toggle: (force?: boolean) => void;
1201
+ /** Checks whether this record is selected. */
1202
+ selected: boolean;
1203
+ /** Gets the value of the record for the specified column. */
1204
+ value: (column: string | Column<RecordType>) => any;
1205
+ /** Gets the extra object of the record for the specified column. */
1206
+ extra: (column: string | Column<RecordType>, path: string) => any;
1207
+ }
1208
+ interface UseTableReturn<T extends Table<any, any>, RecordType extends Record<string, any> = (T extends Table<infer R, any> ? R : any), PaginatorKind extends 'cursor' | 'length-aware' | 'simple' = (T extends Table<any, infer P> ? P : 'length-aware')> extends Omit<UseRefinements, 'filters' | 'sorts' | 'filtersKey' | 'sortsKey'> {
1209
+ /** Selects all records. */
661
1210
  selectAll: () => void;
1211
+ /** Deselects all records. */
662
1212
  deselectAll: () => void;
1213
+ /** Selects records on the current page. */
663
1214
  selectPage: () => void;
1215
+ /** Deselects records on the current page. */
664
1216
  deselectPage: () => void;
1217
+ /** Whether all records on the current page are selected. */
665
1218
  isPageSelected: boolean;
666
- isSelected: (record: RecordTypeWithExtra) => boolean;
1219
+ /** Checks if the given record is selected. */
1220
+ isSelected: (record: RecordType) => boolean;
1221
+ /** Whether all records are selected. */
667
1222
  allSelected: boolean;
1223
+ /** Whether any records are selected. */
1224
+ anySelected: boolean;
1225
+ /** The current record selection. */
668
1226
  selection: BulkSelection<RecordIdentifier>;
1227
+ /** Binds a checkbox to its selection state. */
669
1228
  bindCheckbox: (key: RecordIdentifier) => {
670
1229
  onChange: (event: Event) => void;
671
1230
  checked: boolean;
672
1231
  value: RecordIdentifier;
673
1232
  };
674
- toggle: (record: RecordTypeWithExtra) => void;
675
- select: (record: RecordTypeWithExtra) => void;
676
- deselect: (record: RecordTypeWithExtra) => void;
677
- inlineActions: {
678
- /** The name of this action. */name: string; /** The label of this action. */
679
- label: string; /** The type of this action. */
680
- type: string; /** Custom metadata for this action. */
681
- metadata: any; /** Executes the action. */
682
- execute: (record: RecordTypeWithExtra | RecordIdentifier) => Promise<index_d_exports.NavigationResponse>;
683
- }[];
684
- bulkActions: {
685
- /** Should deselect all records after action. */deselect: boolean; /** The name of this action. */
686
- name: string; /** The label of this action. */
687
- label: string; /** The type of this action. */
688
- type: string; /** Custom metadata for this action. */
689
- metadata: any; /** Executes the action. */
690
- execute: (options?: BulkActionOptions) => Promise<index_d_exports.NavigationResponse>;
691
- }[];
692
- executeInlineAction: (action: Action | string, record: RecordTypeWithExtra | RecordIdentifier) => Promise<index_d_exports.NavigationResponse>;
693
- executeBulkAction: (action: Action | string, options?: BulkActionOptions) => Promise<index_d_exports.NavigationResponse>;
694
- columns: {
695
- /** Toggles sorting for this column. */toggleSort: (options?: ToggleSortOptions) => Promise<index_d_exports.NavigationResponse | undefined>; /** Checks whether the column is being sorted. */
696
- isSorting: (direction?: SortDirection) => boolean; /** Applies the filer for this column. */
697
- applyFilter: (value: any, options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse | undefined>; /** Clears the filter for this column. */
698
- clearFilter: (options?: AvailableHybridRequestOptions) => Promise<index_d_exports.NavigationResponse>; /** Checks whether the column is sortable. */
699
- isSortable: boolean; /** Checks whether the column is filterable. */
700
- isFilterable: boolean; /** The name of this column. */
701
- name: keyof RecordTypeWithExtra; /** The label of this column. */
702
- label: string; /** The type of this column. */
703
- type: string; /** Metadata of this column. */
704
- metadata: Record<string, any>;
705
- }[];
1233
+ /** Toggles selection for the given record. */
1234
+ toggle: (record: RecordType, force?: boolean) => void;
1235
+ /** Toggles selection for all records. */
1236
+ toggleAll: (force?: boolean) => void;
1237
+ /** Selects selection for the given record. */
1238
+ select: (record: RecordType) => void;
1239
+ /** Deselects selection for the given record. */
1240
+ deselect: (record: RecordType) => void;
1241
+ /** List of inline actions for this table. */
1242
+ inlineActions: Array<UseTableInlineActionItem<RecordType>>;
1243
+ /** List of bulk actions for this table. */
1244
+ bulkActions: Array<UseTableBulkActionItem>;
1245
+ /** Executes the given inline action for the given record. */
1246
+ executeInlineAction: (action: InlineAction | string, options: {
1247
+ record: RecordIdentifier | RecordType;
1248
+ } & Omit<HybridRequestOptions, 'url'>) => UseTableNavigationResponse;
1249
+ /** Executes the given bulk action. */
1250
+ executeBulkAction: (action: BulkAction | string, options?: Omit<HybridRequestOptions, 'url'> & {
1251
+ deselect?: boolean;
1252
+ }) => UseTableNavigationResponse;
1253
+ /** List of columns for this table. */
1254
+ columns: Array<UseTableColumn<RecordType>>;
1255
+ /** List of records for this table. */
706
1256
  data: RecordType[];
707
- records: {
708
- /** The actual record. */record: any[]; /** The key of the record. Use this instead of `id`. */
709
- key: RecordIdentifier; /** Executes the given inline action. */
710
- execute: (action: string | InlineAction) => Promise<index_d_exports.NavigationResponse>; /** Gets the available inline actions. */
711
- actions: {
712
- /** Executes the action. */execute: () => Promise<index_d_exports.NavigationResponse>; /** The name of this action. */
713
- name: string; /** The label of this action. */
714
- label: string; /** The type of this action. */
715
- type: string; /** Custom metadata for this action. */
716
- metadata: any;
717
- }[]; /** Selects this record. */
718
- select: () => void; /** Deselects this record. */
719
- deselect: () => void; /** Toggles the selection for this record. */
720
- toggle: (force?: boolean) => void; /** Checks whether this record is selected. */
721
- selected: boolean; /** Gets the value of the record for the specified column. */
722
- value: (column: string | Column<RecordTypeWithExtra>) => RecordType[string] | RecordType[number] | RecordType[symbol]; /** Gets the extra object of the record for the specified column. */
723
- extra: (column: string | Column<RecordTypeWithExtra>, path: string) => any;
724
- }[];
725
- paginator: PaginatorResult<unknown, Omit<PaginatorKindName extends "cursor" ? CursorPaginator<RecordTypeWithExtra> : PaginatorKindName extends "simple" ? SimplePaginator<RecordTypeWithExtra> : Paginator<RecordTypeWithExtra>, "data">>;
726
- };
727
- //#endregion
728
- //#region src/composables/query-parameters.d.ts
1257
+ /** List of records for this table. */
1258
+ records: Array<UseTableRecordItem<RecordType>>;
1259
+ /** Paginated meta and links. */
1260
+ paginator: PaginatorResult<RecordType, Table<RecordType, PaginatorKind>['paginator']>;
1261
+ /** Available filters. */
1262
+ filters: ExtractRefValue<UseRefinements['filters']>;
1263
+ /** Available sorts. */
1264
+ sorts: ExtractRefValue<UseRefinements['sorts']>;
1265
+ /** The key for the filters. */
1266
+ filtersKey: ExtractRefValue<UseRefinements['filtersKey']>;
1267
+ /** The key for the sorts. */
1268
+ sortsKey: ExtractRefValue<UseRefinements['sortsKey']>;
1269
+ }
729
1270
  /**
730
- * Access reactive query parameters.
731
- *
732
- * @see https://hybridly.dev/api/utils/use-query-parameters.html
1271
+ * Provides utilities for working with tables.
733
1272
  */
734
- declare function useQueryParameters<T extends Record<string, any> = Record<string, any>>(): T;
735
- type RouteParameter = string | number | boolean | null | undefined;
736
- type TransformFunction<V extends RouteParameter, R> = (val: V) => R;
737
- type TransformType<T extends RouteParameter, O> = O extends {
738
- transform: 'number';
739
- } ? number : O extends {
740
- transform: 'bool';
741
- } ? boolean : O extends {
742
- transform: 'string';
743
- } ? string : O extends {
744
- transform: 'date';
745
- } ? Date : O extends {
746
- transform: TransformFunction<T, infer R>;
747
- } ? R : T;
748
- interface UseQueryParameterOptions<V extends RouteParameter, R> {
1273
+ declare function useTable<T extends Table<any, any>, RecordType extends Record<string, any> = (T extends Table<infer R, any> ? R : any), PaginatorKind extends 'cursor' | 'length-aware' | 'simple' = (T extends Table<any, infer P> ? P : 'length-aware')>(input: MaybeRefOrGetter<T>, defaultOptions?: TableDefaultOptions): UseTableReturn<T, RecordType, PaginatorKind>;
1274
+ //#endregion
1275
+ //#region src/composables/validation.d.ts
1276
+ /** Accesses all validation errors grouped by bag name. */
1277
+ declare function useValidation<T extends Validation = Validation>(): vue.DeepReadonly<vue.UnwrapNestedRefs<T>>;
1278
+ /** Accesses validation errors for a single bag. */
1279
+ declare function useValidationBag<T extends Errors = Errors>(bag?: string): vue.DeepReadonly<vue.UnwrapNestedRefs<T>>;
1280
+ //#endregion
1281
+ //#region src/default-layout.d.ts
1282
+ type ViewLayout = Component | Component[];
1283
+ type DefaultLayout = ViewLayout | (() => ViewLayout);
1284
+ //#endregion
1285
+ //#region src/plugins/progress.d.ts
1286
+ interface ProgressOptions {
749
1287
  /**
750
- * Specifies a default value if the query parameter does not exist.
1288
+ * The delay after which the progress bar will
1289
+ * appear during navigation, in milliseconds.
1290
+ *
1291
+ * @default 250
751
1292
  */
752
- defaultValue?: MaybeRefOrGetter<R>;
1293
+ delay: number;
753
1294
  /**
754
- * Transforms the query parameter.
1295
+ * The color of the progress bar.
1296
+ *
1297
+ * Defaults to #29d.
755
1298
  */
756
- transform?: 'number' | 'bool' | 'string' | 'date' | TransformFunction<V, R>;
1299
+ color: string;
1300
+ /**
1301
+ * Whether to include the default NProgress styles.
1302
+ *
1303
+ * Defaults to true.
1304
+ */
1305
+ includeCSS: boolean;
1306
+ /**
1307
+ * Whether the NProgress spinner will be shown.
1308
+ *
1309
+ * Defaults to false.
1310
+ */
1311
+ spinner: boolean;
757
1312
  }
758
- /**
759
- * Makes the specified query parameter reactive.
760
- *
761
- * @see https://hybridly.dev/api/utils/use-query-parameter.html
762
- */
763
- declare function useQueryParameter<ParameterType extends RouteParameter = RouteParameter, Options extends UseQueryParameterOptions<ParameterType, any> = UseQueryParameterOptions<ParameterType, ParameterType>>(name: string, options?: Options): Ref<TransformType<ParameterType, Options>>;
764
1313
  //#endregion
765
1314
  //#region src/initialize.d.ts
766
1315
  /**
@@ -790,8 +1339,8 @@ interface InitializeOptions {
790
1339
  setup?: (options: SetupArguments) => any;
791
1340
  /** List of Hybridly plugins. */
792
1341
  plugins?: Plugin$1[];
793
- /** Custom Axios instance. */
794
- axios?: Axios;
1342
+ /** Custom HTTP client instance. */
1343
+ http?: HttpClient;
795
1344
  /**
796
1345
  * Enables the View Transition API, if supported.
797
1346
  * @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition
@@ -799,6 +1348,8 @@ interface InitializeOptions {
799
1348
  viewTransition?: boolean;
800
1349
  /** Options that will apply to all forms by default. Specific forms' options will override them. */
801
1350
  defaultFormOptions?: DefaultFormOptions;
1351
+ /** Default layout applied to views that do not define one. */
1352
+ layout?: DefaultLayout;
802
1353
  }
803
1354
  interface SetupArguments {
804
1355
  /** DOM element to mount Vue on. */
@@ -817,20 +1368,4 @@ interface SetupArguments {
817
1368
  payload: Record<string, any>;
818
1369
  }
819
1370
  //#endregion
820
- //#region src/components/link.d.ts
821
- interface RouterLinkProps {
822
- href?: string;
823
- as?: string | object;
824
- method?: Method | Lowercase<Method>;
825
- data?: RequestData;
826
- external?: boolean;
827
- disabled?: boolean;
828
- options?: Omit<HybridRequestOptions, 'url' | 'data' | 'method'>;
829
- text?: string;
830
- preload?: boolean | 'hover' | 'mount';
831
- preserveScroll?: boolean;
832
- preserveState?: boolean;
833
- }
834
- declare const RouterLink: DefineComponent<RouterLinkProps>;
835
- //#endregion
836
- export { Action, AvailableHybridRequestOptions, BindFilterOptions, BulkAction, BulkSelection, Column, DefaultFormOptions, FormReturn, type InitializeOptions, InlineAction, InternalProperties, MaybeWithData, PaginatorResult, RecordIdentifier, RouterLink, SortDirection, TableDefaultOptions, ToggleSortOptions, can, createPaginator, initializeHybridly, registerHook, route, router, setProperty, useBackForward, useBulkSelect, useDialog, useForm, useHistoryState, useProperties, useProperty, useQueryParameter, useQueryParameters, useRefinements, useRoute, useTable };
1371
+ export { Action, AvailableHybridRequestOptions, AvailableHybridRequestOptionsForFilters, BaseFilterRefinement, BindFilterOptions, BooleanFilterRefinement, BoundBooleanFilterRefinement, BoundCallbackFilterRefinement, BoundDateFilterRefinement, BoundFilterRefinement, BoundSelectFilterRefinement, BoundSortRefinement, BoundTernaryFilterRefinement, BoundTextFilterRefinement, BoundTrashedFilterRefinement, BulkAction, BulkSelection, CallbackFilterRefinement, Column, DateFilterRefinement, DefaultFormOptions, Deferred, FilterOperator, FilterRefinement, Form, type FormProps, FormReturn, type FormSlotProps, type FormSubmitOptions, type InitializeOptions, InlineAction, InternalProperties, MaybeWithData, NumericFilterRefinement, PaginatorResult, RecordIdentifier, Refinements, RouterLink, SelectFilterRefinement, SortDirection, SortRefinement, Table, TableCell, TableCellRow, TableDefaultOptions, TernaryFilterRefinement, TextFilterRefinement, TimeSuggestion, TimeframeSuggestion, ToggleSortOptions, TrashedFilterRefinement, UseRefinements, UseTableBulkActionItem, UseTableColumn, UseTableInlineActionItem, UseTableRecordItem, UseTableReturn, WhenVisible, createPaginator, getBulkSelectionRange, initializeHybridly, isBooleanFilter, isCallbackFilter, isDateFilter, isSelectFilter, isTernaryFilter, isTextFilter, isTrashedFilter, registerHook, route, router, setProperty, useBackForward, useBulkSelect, useDialog, useForm, useHistoryState, useProperties, useProperty, useQueryParameter, useQueryParameters, useRefinements, useRoute, useTable, useValidation, useValidationBag };