UNPKG

adonisjs-livewire

Version:

A front-end framework for AdonisJS

33 lines (32 loc) 1.28 kB
import { AsyncLocalStorage } from 'node:async_hooks'; import { Component } from './component.js'; import { BaseComponent } from './base_component.js'; import ComponentContext from './component_context.js'; import ComponentHook from './component_hook.js'; export declare class DataStore { id: string; lookup: WeakMap<Component | any, any>; constructor(id: string); push(component: Component | BaseComponent, key: string, value: any, iKey?: string): void; set(component: Component | BaseComponent, key: string, value: any): void; get(component: Component | BaseComponent, key: string): any; has(component: Component | BaseComponent, key: string): any; } export declare const livewireContext: AsyncLocalStorage<{ dataStore: DataStore; context: ComponentContext; features: ComponentHook[]; }>; export declare const getLivewireContext: () => { dataStore: DataStore; context: ComponentContext; features: ComponentHook[]; } | undefined; export declare function store(component: Component | BaseComponent): { readonly lookup: WeakMap<any, any>; id(): string; push: (key: string, value: any, iKey?: string) => void; get: (key: string) => any; has: (key: string) => any; set: (key: string, value: any) => void; };