marko
Version:
Optimized runtime for Marko templates.
23 lines (22 loc) • 1.39 kB
TypeScript
import { type Binding, type ParamBinding } from "./bindings";
import { Sorted, type SortedOpt } from "./optional";
export interface Sources {
state: SortedOpt<Binding>;
param: SortedOpt<ParamBinding>;
global: true | undefined;
/** Read whatever changes, as an effect or handler reads on resume; the
* other fields still say what it reads. */
always: true | undefined;
}
export declare const ALWAYS: Sources;
export declare const globalSources: Sources;
export declare function sharesSources(a: Binding, b: Binding): boolean;
export declare function createSources(state: Sources["state"], param: Sources["param"], global?: Sources["global"], always?: Sources["always"]): Sources;
export declare function withSources(sources: Sources, state: Sources["state"], param: Sources["param"]): Sources | undefined;
export declare const sourcesUtil: Sorted<Sources>;
export declare function compareSources(a: Sources, b: Sources): number;
export declare function mergeSources(a: Sources, b: undefined | Sources): Sources;
export declare function mergeSources(a: undefined | Sources, b: Sources): Sources;
export declare function mergeSources(a: undefined | Sources, b: undefined | Sources): Sources | undefined;
export declare function isInParams(binding: Binding, params: Sources["param"]): boolean;
export declare function isSupersetSources(a: Binding, b: Binding): boolean;