alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
20 lines (19 loc) • 799 B
TypeScript
import * as Y from 'yjs';
import { Label } from '../Label.js';
import { Shape } from '../Shape.js';
export type ScalarMutator<T> = (value: T) => void;
export declare class ScalarShape<T> implements Shape<T, ScalarMutator<T>> {
label: Label;
initialValue?: T | undefined;
constructor(label: Label, initialValue?: T | undefined);
innerTypes(): never[];
create(): T;
typeOfChild<C>(yValue: T, child: string): Shape<C>;
toY(value: T): T;
fromY(yValue: any): any;
applyY(value: T, parent: Y.Map<any>, key: string): void;
init(parent: Y.Map<any>, key: string): void;
watch(parent: Y.Map<any>, key: string): (fun: () => void) => () => void;
mutator(parent: Y.Map<any>, key: string, readOnly?: boolean): (value: T) => void;
applyLinks(): Promise<void>;
}