UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

20 lines (19 loc) 799 B
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>; }