Staquia API
    Preparing search index...

    Interface Item<K>

    The fields an object needs to be stored in a LexicalList. Your objects can have any other field.

    import type { Item } from "staquia";

    interface Task extends Item<number> {
    title: string;
    }

    // A new object starts with an empty position: the list gives it one
    const task: Task = { id: 1, title: "Write", position: "" };
    interface Item<K> {
        id: K;
        position: string;
    }

    Type Parameters

    • K

      The type of the id.

    Index

    Properties

    Properties

    id: K

    The unique identifier of the object, never null or undefined.

    position: string

    The position of the object as a string, kept in sync by the list. Store it and sort by it.