Function typed

  • Use this function to specify a TypeScript type for a UI5 type.

    Example

    import Control from "sap/ui/Control";

    ui5Extend("optional.name.MyControl")
    export class MyControl extends Ui5Base(Control, {
    metadata: {
    properties: {
    state: {
    type: typed<"on" | "off" | "maybe">()("string")
    }
    },
    // …
    }
    }) {
    // …
    }

    Type Parameters

    • T

    Returns (<const U>(value) => U & {
        [typeTag]: T;
    })

      • <const U>(value): U & {
            [typeTag]: T;
        }
      • Type Parameters

        • const U extends string

        Parameters

        • value: U

        Returns U & {
            [typeTag]: T;
        }

Generated using TypeDoc