import * as nt from 'noodl-types'; import type { ActionChainObserver } from 'noodl-action-chain'; import type { OrArray } from '@jsmanifest/typefest'; import type ActionsCache from './cache/ActionsCache'; import NuiPage from './Page'; import VP from './Viewport'; import log from './utils/log'; import { groupedActionTypes } from './constants'; import * as t from './types'; declare const NUI: { _experimental: { readonly register: { (name: string, fn: t.Register.Object["fn"] | Partial, options?: Partial): t.Register.Object; (registerComponent: nt.RegisterComponentObject, options?: Partial | t.Register.Object["fn"]): t.Register.Object; }; }; readonly cache: { actions: ActionsCache & Record<"anonymous" | "goto" | "toast" | "evalObject" | "openCamera" | "openPhotoLibrary" | "openDocumentManager" | "pageJump" | "popUp" | "popUpDismiss" | "refresh" | "removeSignature" | "saveObject" | "saveSignature" | "getLocationAddress" | "updateGlobal" | "scanCamera" | "updateObject", t.Store.ActionObject<"anonymous" | "goto" | "toast" | "evalObject" | "openCamera" | "openPhotoLibrary" | "openDocumentManager" | "pageJump" | "popUp" | "popUpDismiss" | "refresh" | "removeSignature" | "saveObject" | "saveSignature" | "getLocationAddress" | "updateGlobal" | "scanCamera" | "updateObject", string>[]> & { builtIn: Map; emit: Map, t.Store.ActionObject[]>; register: Record; }; component: import(".").ComponentCache; page: import(".").PageCache; plugin: import(".").PluginCache; register: import(".").RegisterCache; transactions: import(".").TransactionsCache; timer: import("./cache/TimerCache").default; }; readonly clean: (page: NuiPage, onClean?: (stats?: { componentsRemoved: number; }) => void) => void; readonly createGetter: (page?: NuiPage) => (key?: string, { dataObject, iteratorVar, page: priorityPage, pageObject, }?: { dataObject?: any; iteratorVar?: string; page?: NuiPage; pageObject?: nt.PageObject; }) => any; readonly createGoto: (fn: t.GotoFn) => (args: Parameters[0]) => any[]; readonly createComponent: (componentObject: t.NuiComponentType | t.NuiComponent.Instance | nt.ComponentObject | null | undefined, page: NuiPage) => t.NuiComponent.Instance; createPage(args?: string | NuiPage /** * If a component instance is given, we must set its page id to the * component id, emit the PAGE_CREATED component event and set the * "page" prop using the page instance */ | t.NuiComponent.Instance | { name?: string; component?: t.NuiComponent.Instance; id?: string; onChange?: { id?: string; fn: (prev: string, next: string) => void; }; viewport?: VP | { width?: number; height?: number; }; }): NuiPage; createPlugin(location?: t.Plugin.Location | t.Plugin.ComponentObject | t.NuiComponent.Instance, obj?: t.NuiComponent.Instance | t.Plugin.ComponentObject): t.Plugin.Object; createActionChain(trigger: t.NUITrigger, actions: OrArray, opts?: ActionChainObserver & { component?: t.NuiComponent.Instance; context?: Record; on?: t.ResolveComponentOptions["on"]; loadQueue?: boolean; id?: string; page?: NuiPage; }, id?: string): t.NUIActionChain; readonly createSrc: { (args: { key: string; value: nt.Path; component: t.NuiComponent.Instance; page: NuiPage; }): Promise; (path: nt.Path, opts?: { component: t.NuiComponent.Instance; context?: Record; }): Promise; (path: nt.IfObject, opts?: { component?: t.NuiComponent.Instance; page?: NuiPage; }): Promise; (path: string): Promise; }; readonly emit: { (opts?: t.NUIEmit.EmitRegister): Promise; (obj?: t.NUIEmit.EmitTransaction): Promise[0]>; }; getAssetsUrl: () => string; getActions: { (): ActionsCache; (actionType: "emit"): Map[]>; (actionType: "builtIn"): Map; (actionType: AType): t.Store.ActionObject[]; }; getBuiltIns: () => Map[]>; getBaseUrl: () => string; getBaseStyles(component: t.NuiComponent.Instance | Record, originalComponent?: t.NuiComponent.Instance | Record): any; getConsumerOptions({ callback, component, on, page, context, ...rest }: { callback?(component: t.NuiComponent.Instance): t.NuiComponent.Instance | undefined; component?: t.NuiComponent.Instance; on?: t.ResolveComponentOptions["on"]; page: NuiPage; context?: Record; } & { [key: string]: any; }): { callback: ((component: t.NuiComponent.Instance) => t.NuiComponent.Instance | undefined) | undefined; cache: { actions: ActionsCache & Record<"anonymous" | "goto" | "toast" | "evalObject" | "openCamera" | "openPhotoLibrary" | "openDocumentManager" | "pageJump" | "popUp" | "popUpDismiss" | "refresh" | "removeSignature" | "saveObject" | "saveSignature" | "getLocationAddress" | "updateGlobal" | "scanCamera" | "updateObject", t.Store.ActionObject<"anonymous" | "goto" | "toast" | "evalObject" | "openCamera" | "openPhotoLibrary" | "openDocumentManager" | "pageJump" | "popUp" | "popUpDismiss" | "refresh" | "removeSignature" | "saveObject" | "saveSignature" | "getLocationAddress" | "updateGlobal" | "scanCamera" | "updateObject", string>[]> & { builtIn: Map; emit: Map, t.Store.ActionObject[]>; register: Record; }; component: import(".").ComponentCache; page: import(".").PageCache; plugin: import(".").PluginCache; register: import(".").RegisterCache; transactions: import(".").TransactionsCache; timer: import("./cache/TimerCache").default; }; component: t.NuiComponent.Instance | undefined; context: Record | undefined; createPage: (args?: string | NuiPage /** * If a component instance is given, we must set its page id to the * component id, emit the PAGE_CREATED component event and set the * "page" prop using the page instance */ | t.NuiComponent.Instance | { name?: string; component?: t.NuiComponent.Instance; id?: string; onChange?: { id?: string; fn: (prev: string, next: string) => void; }; viewport?: VP | { width?: number; height?: number; }; }) => NuiPage; createActionChain(trigger: t.NUITrigger, actions: t.NUIActionObject | t.NUIActionObject[], { context: contextProp, loadQueue, }?: { context?: Record; loadQueue?: boolean; }, id?: string): t.NUIActionChain; createSrc(key: string, value: string | nt.IfObject | nt.EmitObjectFold): Promise; emit: { (opts?: t.NUIEmit.EmitRegister): Promise; (obj?: t.NUIEmit.EmitTransaction): Promise[0]>; }; getBaseStyles: any; getQueryObjects: (opts?: { component?: t.NuiComponent.Instance; page?: NuiPage; queries?: () => Record | (() => Record)[]; listDataObject?: any; }) => any[]; on: t.On | undefined; page: any; resolveComponents: { , Context extends Record = Record>(opts: t.ResolveComponentOptions): Promise; , Context extends Record = Record>(component: C, page?: NuiPage): Promise; , Context extends Record = Record>(component: C, options?: Omit, "component">): Promise; }; viewport: any; _experimental: { readonly register: { (name: string, fn: t.Register.Object["fn"] | Partial, options?: Partial): t.Register.Object; (registerComponent: nt.RegisterComponentObject, options?: Partial | t.Register.Object["fn"]): t.Register.Object; }; }; clean: (page: NuiPage, onClean?: (stats?: { componentsRemoved: number; }) => void) => void; createGetter: (page?: NuiPage) => (key?: string, { dataObject, iteratorVar, page: priorityPage, pageObject, }?: { dataObject?: any; iteratorVar?: string; page?: NuiPage; pageObject?: nt.PageObject; }) => any; createGoto: (fn: t.GotoFn) => (args: Parameters[0]) => any[]; createComponent: (componentObject: t.NuiComponentType | t.NuiComponent.Instance | nt.ComponentObject | null | undefined, page: NuiPage) => t.NuiComponent.Instance; createPlugin(location?: t.Plugin.Location | t.Plugin.ComponentObject | t.NuiComponent.Instance, obj?: t.NuiComponent.Instance | t.Plugin.ComponentObject): t.Plugin.Object; getAssetsUrl: () => string; getActions: { (): ActionsCache; (actionType: "emit"): Map[]>; (actionType: "builtIn"): Map; (actionType: AType): t.Store.ActionObject[]; }; getBuiltIns: () => Map[]>; getBaseUrl: () => string; getConsumerOptions({ callback, component, on, page, context, ...rest }: { callback?(component: t.NuiComponent.Instance): t.NuiComponent.Instance | undefined; component?: t.NuiComponent.Instance; on?: t.ResolveComponentOptions["on"]; page: NuiPage; context?: Record; } & { [key: string]: any; }): any; getPlugins(location?: t.Plugin.Location): Map; getPages(): string[]; getPreloadPages(): string[]; getRoot(): Record; getRootPage(): NuiPage; reset(): void; setLogLevel: (level: keyof typeof log.levels) => void; use(args: t.UseArg): any; getSize(size: string, type: "height" | "width"): string; }; getPlugins(location?: t.Plugin.Location): Map; getPages(): string[]; getPreloadPages(): string[]; getRoot(): Record; getRootPage(): NuiPage; readonly resolveComponents: { , Context extends Record = Record>(opts: t.ResolveComponentOptions): Promise; , Context extends Record = Record>(component: C, page?: NuiPage): Promise; , Context extends Record = Record>(component: C, options?: Omit, "component">): Promise; }; reset(): void; setLogLevel: (level: keyof typeof log.levels) => void; use(args: t.UseArg): any; getSize(size: string, type: "height" | "width"): string; }; export default NUI;