import type { Description } from '@aeriajs/types'; import type { file } from '@aeriajs/builtins'; import { Result } from '@aeriajs/types'; import { type IndividualActionPayload } from '../composables/use-action.js'; export type User = { _id: string; name: string; roles: string[]; password?: string; picture_file?: typeof file.item & { _id: string; }; }; export type SuccessfulAuthentication = { token: { type: 'bearer'; content: string; }; user: User; }; export type Credentials = { email: string; password: string; }; export declare const user: (context: import("@aeria-ui/state-management").StoreContext, config?: unknown) => import("../state/collection.js").InitialState> & { item: { _id: string; name: string; roles: string[]; password?: string | undefined; picture_file?: { type: string; name: string; link: never; immutable: boolean; size: number; last_modified: Date; absolute_path: string; relative_path: string; download_link: never; owner?: { _id: { readonly _bsontype: "ObjectId"; id: { [x: number]: number; readonly BYTES_PER_ELEMENT: number; readonly buffer: { readonly byteLength: number; slice: (begin?: number, end?: number) => ArrayBuffer; readonly maxByteLength: number; readonly resizable: boolean; resize: (newByteLength?: number) => void; readonly detached: boolean; transfer: (newByteLength?: number) => ArrayBuffer; transferToFixedLength: (newByteLength?: number) => ArrayBuffer; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly byteLength: number; slice: (begin?: number, end?: number) => SharedArrayBuffer; readonly growable: boolean; readonly maxByteLength: number; grow: (newByteLength?: number) => void; readonly [Symbol.toStringTag]: "SharedArrayBuffer"; }; readonly byteLength: number; readonly byteOffset: number; copyWithin: (target: number, start: number, end?: number) => Uint8Array; every: (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean; fill: (value: number, start?: number, end?: number) => Uint8Array; filter: (predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any) => Uint8Array; find: (predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any) => number | undefined; findIndex: (predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any) => number; forEach: (callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any) => void; indexOf: (searchElement: number, fromIndex?: number) => number; join: (separator?: string) => string; lastIndexOf: (searchElement: number, fromIndex?: number) => number; readonly length: number; map: (callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any) => Uint8Array; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; }; reverse: () => Uint8Array; set: (array: ArrayLike, offset?: number) => void; slice: (start?: number, end?: number) => Uint8Array; some: (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean; sort: (compareFn?: ((a: number, b: number) => number) | undefined) => Uint8Array; subarray: (begin?: number, end?: number) => Uint8Array; toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions): string; }; toString: () => string; valueOf: () => Uint8Array; entries: () => ArrayIterator<[number, number]>; keys: () => ArrayIterator; values: () => ArrayIterator; includes: (searchElement: number, fromIndex?: number) => boolean; at: (index: number) => number | undefined; findLast: { (predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S | undefined; (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number | undefined; }; findLastIndex: (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => number; toReversed: () => Uint8Array; toSorted: (compareFn?: ((a: number, b: number) => number) | undefined) => Uint8Array; with: (index: number, value: number) => Uint8Array; [Symbol.iterator]: () => ArrayIterator; readonly [Symbol.toStringTag]: "Uint8Array"; }; toHexString: () => string; toString: (encoding?: "hex" | "base64") => string; toJSON: () => string; equals: (otherId: string | import("bson").ObjectId | import("bson").ObjectIdLike | undefined | null) => boolean; getTimestamp: () => Date; inspect: (depth?: number, options?: unknown, inspect?: (x: unknown, options?: unknown) => string) => string; }; } | undefined; updated_at?: Date | undefined; created_at?: Date | undefined; _id: import("bson").ObjectId & string; } | undefined; }; currentUser: { _id: string; name: string; roles: string[]; password?: string | undefined; picture_file?: { type: string; name: string; link: never; immutable: boolean; size: number; last_modified: Date; absolute_path: string; relative_path: string; download_link: never; owner?: { _id: { readonly _bsontype: "ObjectId"; id: { [x: number]: number; readonly BYTES_PER_ELEMENT: number; readonly buffer: { readonly byteLength: number; slice: (begin?: number, end?: number) => ArrayBuffer; readonly maxByteLength: number; readonly resizable: boolean; resize: (newByteLength?: number) => void; readonly detached: boolean; transfer: (newByteLength?: number) => ArrayBuffer; transferToFixedLength: (newByteLength?: number) => ArrayBuffer; readonly [Symbol.toStringTag]: "ArrayBuffer"; } | { readonly byteLength: number; slice: (begin?: number, end?: number) => SharedArrayBuffer; readonly growable: boolean; readonly maxByteLength: number; grow: (newByteLength?: number) => void; readonly [Symbol.toStringTag]: "SharedArrayBuffer"; }; readonly byteLength: number; readonly byteOffset: number; copyWithin: (target: number, start: number, end?: number) => Uint8Array; every: (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean; fill: (value: number, start?: number, end?: number) => Uint8Array; filter: (predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any) => Uint8Array; find: (predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any) => number | undefined; findIndex: (predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any) => number; forEach: (callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any) => void; indexOf: (searchElement: number, fromIndex?: number) => number; join: (separator?: string) => string; lastIndexOf: (searchElement: number, fromIndex?: number) => number; readonly length: number; map: (callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any) => Uint8Array; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; }; reverse: () => Uint8Array; set: (array: ArrayLike, offset?: number) => void; slice: (start?: number, end?: number) => Uint8Array; some: (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean; sort: (compareFn?: ((a: number, b: number) => number) | undefined) => Uint8Array; subarray: (begin?: number, end?: number) => Uint8Array; toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions): string; }; toString: () => string; valueOf: () => Uint8Array; entries: () => ArrayIterator<[number, number]>; keys: () => ArrayIterator; values: () => ArrayIterator; includes: (searchElement: number, fromIndex?: number) => boolean; at: (index: number) => number | undefined; findLast: { (predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S | undefined; (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number | undefined; }; findLastIndex: (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => number; toReversed: () => Uint8Array; toSorted: (compareFn?: ((a: number, b: number) => number) | undefined) => Uint8Array; with: (index: number, value: number) => Uint8Array; [Symbol.iterator]: () => ArrayIterator; readonly [Symbol.toStringTag]: "Uint8Array"; }; toHexString: () => string; toString: (encoding?: "hex" | "base64") => string; toJSON: () => string; equals: (otherId: string | import("bson").ObjectId | import("bson").ObjectIdLike | undefined | null) => boolean; getTimestamp: () => Date; inspect: (depth?: number, options?: unknown, inspect?: (x: unknown, options?: unknown) => string) => string; }; } | undefined; updated_at?: Date | undefined; created_at?: Date | undefined; _id: import("bson").ObjectId & string; } | undefined; }; credentials: { email: string; password: string; }; description: { indexes?: readonly string[] | undefined; form?: readonly string[] | Record | undefined; actions?: import("@aeriajs/types").CollectionActions | undefined; individualActions?: import("@aeriajs/types").CollectionActions | undefined; layout?: { name: import("@aeriajs/types").LayoutName; options?: { title?: string | undefined; picture?: string | undefined; badge?: string | undefined; information?: string | readonly string[] | undefined; active?: string | undefined; translateBadge?: boolean | undefined; } | undefined; } | undefined; tableLayout?: { actions?: Partial>> | undefined; } | undefined; type?: "object" | undefined; required?: readonly string[] | Partial>> | undefined; table?: readonly string[] | undefined; icon?: import("@aeriajs/types").Icon | undefined; hidden?: boolean | undefined; writable?: readonly string[] | undefined; route?: readonly string[] | undefined; freshItem?: Partial> | undefined; filters?: readonly (string | { property: string; default: string; })[] | undefined; search?: { indexes: readonly (string | number | symbol)[]; placeholder?: string | undefined; exactMatches?: boolean | undefined; } | undefined; filtersPresets?: Record> | undefined; tableMeta?: readonly string[] | undefined; formLayout?: { fields?: Partial>> | undefined; } | undefined; owned?: import("@aeriajs/types").OwnershipMode | undefined; $id: string; title?: string | undefined; categories?: readonly string[] | undefined; preferred?: Record>> | undefined; defaults?: Record | undefined; unique?: readonly string[] | undefined; temporary?: { index: string; expireAfterSeconds: number; } | undefined; timestamps?: false | undefined; immutable?: boolean | ((doc: import("mongodb").WithId) => boolean | Promise) | readonly (string | number | symbol)[] | undefined; presets?: readonly import("@aeriajs/types").DescriptionPreset[] | undefined; properties: { roles: { items: { enum: string[]; }; }; }; }; } & import("@aeria-ui/state-management").UnwrapGetters Record & { roles: { items: { enum: string[]; }; }; }; signedIn: () => boolean; } & { $currentLayout: import("vue").ComputedRef<"tabular" | "grid" | "list">; $filters: import("vue").ComputedRef>; $freshItem: import("vue").ComputedRef>; actions: import("vue").ComputedRef; condensedItem: import("vue").ComputedRef; description: import("vue").ComputedRef; diffedItem: import("vue").ComputedRef>>; filtersCount: import("vue").ComputedRef; hasActiveFilters: import("vue").ComputedRef; hasSelectionActions: import("vue").ComputedRef; individualActions: import("vue").ComputedRef; isInsertReady: import("vue").ComputedRef; itemsCount: import("vue").ComputedRef; layout: import("vue").ComputedRef; properties: import("vue").ComputedRef>; references: import("vue").ComputedRef<[string, import("@aeriajs/types").Property][]>; tableLayout: import("vue").ComputedRef>; tableProperties: import("vue").ComputedRef>; }>> & { $id: "user"; $actions: { setItem(item: import("../state/collection.js").CollectionStoreItem): import("../state/collection.js").CollectionStoreItem; setItems(items: import("../state/collection.js").CollectionStoreItem[]): import("../state/collection.js").CollectionStoreItem[]; insertItem(_item: import("../state/collection.js").CollectionStoreItem, options?: { merge: boolean; }): Partial & Record & { _id: any; }; removeItem({ error, result: subject }: Result.Either): { readonly _tag: "Error"; readonly error: import("@aeriajs/types").EndpointError; readonly result: undefined; } | { readonly _tag: "Result"; readonly error: undefined; readonly result: import("../state/collection.js").CollectionStoreItem; }; clearItem(): import("../state/collection.js").CollectionStoreItem; clearItems(): import("../state/collection.js").CollectionStoreItem[]; custom(verb: string | null, payload?: unknown, options?: import("../index.js").CustomOptions): Promise; count(payload: import("@aeriajs/types").CountPayload): Promise; get(payload: import("@aeriajs/types").GetPayload, options?: import("../index.js").CustomOptions): Promise>; retrieveItems(payload?: import("@aeriajs/types").GetAllPayload): Promise>; getAll(_payload?: import("@aeriajs/types").GetAllPayload): Promise>; insert(payload?: import("@aeriajs/types").InsertPayload, options?: import("../index.js").CustomOptions): Promise<{ readonly _tag: "Error"; readonly error: import("@aeriajs/types").EndpointError; readonly result: undefined; } | { readonly _tag: "Result"; readonly error: undefined; readonly result: Partial & Record & { _id: any; }; }>; deepInsert(payload?: import("@aeriajs/types").InsertPayload, options?: import("../index.js").CustomOptions): Promise<{ readonly _tag: "Error"; readonly error: import("@aeriajs/types").EndpointError; readonly result: undefined; } | { readonly _tag: "Result"; readonly error: undefined; readonly result: Partial & Record & { _id: any; }; }>; remove(payload: import("@aeriajs/types").RemovePayload, options?: import("../index.js").CustomOptions): Promise<{ readonly _tag: "Error"; readonly error: import("@aeriajs/types").EndpointError; readonly result: undefined; } | { readonly _tag: "Result"; readonly error: undefined; readonly result: import("../state/collection.js").CollectionStoreItem; }>; removeAll(payload: import("@aeriajs/types").RemoveAllPayload, options?: import("../index.js").CustomOptions): Promise>; filter(props?: import("@aeriajs/types").GetAllPayload): Promise>; updateItems(): Promise>; clearFilters(): Record; useProperties(properties: (string)[]): {}; usePropertiesExcept(properties: (string)[]): { [k: string]: import("@aeriajs/types").Property; }; formatValue(args: { value: unknown; key: string; form?: boolean; property: import("@aeriajs/types").Property; index?: string; }): unknown; select(properties: (string)[], item?: import("../state/collection.js").CollectionStoreItem): {}; selectManyItems(items: import("../state/collection.js").CollectionStoreItem[], value?: boolean): import("../state/collection.js").CollectionStoreItem[]; selectAllItems(state?: boolean): import("../state/collection.js").CollectionStoreItem[]; } & { setCurrentUser: (auth: SuccessfulAuthentication | null) => void; signout: () => void; authenticate(payload: Credentials | { revalidate: true; }): Promise<{ readonly _tag: "Error"; readonly error: (Pick> & { code: "AUTHORIZATION_ERROR" | "INVALID_CREDENTIALS" | "INACTIVE_USER"; httpStatus: 401; message: string; details: any; }, never>, "httpStatus" | "code"> & Partial> & { code: "AUTHORIZATION_ERROR" | "INVALID_CREDENTIALS" | "INACTIVE_USER"; httpStatus: 401; message: string; details: any; }, never>>) | (Pick> & { code: "AUTHORIZATION_ERROR" | "INVALID_CREDENTIALS" | "INACTIVE_USER"; httpStatus: 401; message: string; details: any; }, never>, "httpStatus" | "code"> & Partial> & { code: "AUTHORIZATION_ERROR" | "INVALID_CREDENTIALS" | "INACTIVE_USER"; httpStatus: 401; message: string; details: any; }, never>>); readonly result: undefined; } | { readonly _tag: "Result"; readonly error: undefined; readonly result: ({ user: import("@aeriajs/types").SchemaWithId<{ readonly $id: "user"; readonly icon: "users"; readonly required: readonly ["name", "roles", "email"]; readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"]; readonly indexes: readonly ["name"]; readonly unique: readonly ["email"]; readonly properties: { readonly name: { readonly type: "string"; readonly minLength: 1; }; readonly given_name: { readonly type: "getter"; readonly getter: (doc: object) => string | undefined; }; readonly family_name: { readonly type: "getter"; readonly getter: (doc: object) => string | undefined; }; readonly active: { readonly type: "boolean"; }; readonly roles: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly uniqueItems: true; readonly minItems: 1; }; readonly email: { readonly type: "string"; readonly inputType: "email"; readonly minLength: 3; }; readonly password: { readonly type: "string"; readonly inputType: "password"; readonly hidden: true; }; readonly phone_number: { readonly type: "string"; readonly mask: "(##) #####-####"; }; readonly picture_file: { readonly $ref: "file"; readonly accept: readonly ["image/*"]; }; readonly picture: { readonly type: "getter"; readonly getter: (doc: object) => Promise | undefined; }; readonly self_registered: { readonly type: "boolean"; readonly readOnly: true; }; readonly updated_at: { readonly type: "string"; readonly format: "date-time"; }; }; readonly presets: readonly ["crud", "duplicate"]; readonly layout: { readonly name: "grid"; readonly options: { readonly title: "name"; readonly badge: "roles"; readonly picture: "picture_file"; readonly information: "email"; readonly active: "active"; readonly translateBadge: true; }; }; readonly individualActions: { readonly changePassword: { readonly label: "change_password"; readonly icon: "key"; readonly translate: true; readonly route: { readonly name: "/dashboard/user/changepass"; readonly fetchItem: true; }; }; readonly copyRedefinePasswordLink: { readonly label: "copy_redefine_password_link"; readonly icon: "link"; readonly translate: true; }; readonly copyActivationLink: { readonly label: "copy_activation_link"; readonly icon: "link"; readonly translate: true; }; }; readonly filters: readonly ["name", "roles", "email", "phone_number"]; readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"]; readonly tableMeta: readonly ["email"]; readonly formLayout: { readonly fields: { readonly given_name: { readonly span: 3; }; readonly family_name: { readonly span: 3; }; }; }; }>; } & Omit> & { user: never; token: {} & Omit> & { type: "bearer"; content: string; }, never>; }, "user">) | Omit> & { user: {} & Omit> & { name: string; _id: null; roles: string[]; email: string; active: boolean; }, never>; token: {} & Omit> & { type: string; content: string; }, never>; }, never> | ({ user: import("@aeriajs/types").SchemaWithId<{ readonly $id: "user"; readonly icon: "users"; readonly required: readonly ["name", "roles", "email"]; readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"]; readonly indexes: readonly ["name"]; readonly unique: readonly ["email"]; readonly properties: { readonly name: { readonly type: "string"; readonly minLength: 1; }; readonly given_name: { readonly type: "getter"; readonly getter: (doc: object) => string | undefined; }; readonly family_name: { readonly type: "getter"; readonly getter: (doc: object) => string | undefined; }; readonly active: { readonly type: "boolean"; }; readonly roles: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly uniqueItems: true; readonly minItems: 1; }; readonly email: { readonly type: "string"; readonly inputType: "email"; readonly minLength: 3; }; readonly password: { readonly type: "string"; readonly inputType: "password"; readonly hidden: true; }; readonly phone_number: { readonly type: "string"; readonly mask: "(##) #####-####"; }; readonly picture_file: { readonly $ref: "file"; readonly accept: readonly ["image/*"]; }; readonly picture: { readonly type: "getter"; readonly getter: (doc: object) => Promise | undefined; }; readonly self_registered: { readonly type: "boolean"; readonly readOnly: true; }; readonly updated_at: { readonly type: "string"; readonly format: "date-time"; }; }; readonly presets: readonly ["crud", "duplicate"]; readonly layout: { readonly name: "grid"; readonly options: { readonly title: "name"; readonly badge: "roles"; readonly picture: "picture_file"; readonly information: "email"; readonly active: "active"; readonly translateBadge: true; }; }; readonly individualActions: { readonly changePassword: { readonly label: "change_password"; readonly icon: "key"; readonly translate: true; readonly route: { readonly name: "/dashboard/user/changepass"; readonly fetchItem: true; }; }; readonly copyRedefinePasswordLink: { readonly label: "copy_redefine_password_link"; readonly icon: "link"; readonly translate: true; }; readonly copyActivationLink: { readonly label: "copy_activation_link"; readonly icon: "link"; readonly translate: true; }; }; readonly filters: readonly ["name", "roles", "email", "phone_number"]; readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"]; readonly tableMeta: readonly ["email"]; readonly formLayout: { readonly fields: { readonly given_name: { readonly span: 3; }; readonly family_name: { readonly span: 3; }; }; }; }>; } & Omit> & { user: never; token: {} & Omit> & { type: "bearer"; content: string; }, never>; }, "user">) | Omit> & { user: {} & Omit> & { name: string; _id: null; roles: string[]; email: string; active: boolean; }, never>; token: {} & Omit> & { type: string; content: string; }, never>; }, never>; }>; copyRedefinePasswordLink({ filters }: IndividualActionPayload<{ _id: string; }>): Promise; copyActivationLink({ filters }: IndividualActionPayload<{ _id: string; }>): Promise; }; $functions: Record unknown>; };