@metreeca/blue - v0.9.1
    Preparing search index...

    Function local

    Creates a single-valued language-tagged map shape.

    • Creates a single-valued language-tagged map shape with a typed model value and no other constraints.

      Type Parameters

      • M extends Local

        The literal type for the model

      Parameters

      • model: M

        Prototype value for runtime model assembly

      Returns LocalShape & { model: M }

      A shape with model typed as M

      const title = local({ "*": "Untitled" } as const);
      
    • Creates a single-valued language-tagged map shape with optional validation constraints.

      Parameters

      Returns LocalShape

      A shape with model typed as Local

      If constraints is not a valid LocalConstraints

      const label = local();
      const name = local({ minLength: 1, maxLength: 100 });
      const text = local({ languageIn: ["en", "it"] });