@zedux/atoms
Version:
A Molecular State Engine for React
28 lines (27 loc) • 1.41 kB
TypeScript
import { AtomConfig, AtomValueOrFactory, AtomGenerics } from '../../types/index.js';
import { Ecosystem } from '../Ecosystem.js';
import { AtomInstance } from '../instances/AtomInstance.js';
export declare abstract class AtomTemplateBase<G extends AtomGenerics, InstanceType extends AtomInstance<G>> {
readonly key: string;
readonly _value: AtomValueOrFactory<G>;
protected readonly _config?: AtomConfig<G["State"]> | undefined;
static $$typeof: symbol;
readonly dehydrate?: AtomConfig<G['State']>['dehydrate'];
readonly flags?: string[];
readonly hydrate?: AtomConfig<G['State']>['hydrate'];
readonly manualHydration?: boolean;
readonly ttl?: number;
/**
* Set this to true when this atom template is a known override of another
* atom template with the same key.
*
* This has no built-in functionality, but it allows plugins to identify
* potentially problematic duplicate atom keys e.g. by hooking into the
* `instanceReused` mod and logging a warning if the templates don't match and
* neither is an override.
*/
_isOverride?: boolean;
constructor(key: string, _value: AtomValueOrFactory<G>, _config?: AtomConfig<G["State"]> | undefined);
abstract _createInstance(ecosystem: Ecosystem, id: string, params: G['Params']): InstanceType;
abstract getInstanceId(ecosystem: Ecosystem, params?: G['Params']): string;
}