How to use the ts-interface-checker.enumlit function in ts-interface-checker

To help you get started, we’ve selected a few ts-interface-checker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gristlabs / ts-interface-builder / test / fixtures / sample-ti.ts View on Github external
"xMyType": "MyType",
  "xarray": t.array("string"),
  "xarray2": t.array("MyType"),
  "xtuple": t.tuple("string", "number"),
  "xunion": t.union("number", "null"),
  "xparen": t.union("number", "string"),
  "xiface": t.iface([], {
    "foo": "string",
    "bar": "number",
  }),
  "xliteral": t.union(t.lit("foo"), t.lit("ba\"r"), t.lit(3)),
  "xfunc": t.func("number", t.param("price", "number"), t.param("quantity", "number")),
  "xfunc2": t.func("number", t.param("price", "number"), t.param("quantity", "number", true)),
  "xDirection": "Direction",
  "xDirectionStr": "DirectionStr",
  "xDirUp": t.union(t.enumlit("Direction", "Up"), t.enumlit("Direction", "Left")),
  "xDirStrLeft": t.enumlit("DirectionStr", "Left"),
  "ximplicit": "any",
  "ximplicitFunc": t.func("number", t.param("price", "any")),
  "ximplicitFunc2": t.func("any", t.param("price", "any")),
});

const exportedTypeSuite: t.ITypeSuite = {
  ICacheItem,
  ILRUCache,
  MyType,
  NumberAlias,
  NumberAlias2,
  SomeEnum,
  Direction,
  DirectionStr,
  BooleanLikeHeterogeneousEnum,
github gristlabs / ts-interface-builder / test / fixtures / sample-ti.ts View on Github external
"xarray": t.array("string"),
  "xarray2": t.array("MyType"),
  "xtuple": t.tuple("string", "number"),
  "xunion": t.union("number", "null"),
  "xparen": t.union("number", "string"),
  "xiface": t.iface([], {
    "foo": "string",
    "bar": "number",
  }),
  "xliteral": t.union(t.lit("foo"), t.lit("ba\"r"), t.lit(3)),
  "xfunc": t.func("number", t.param("price", "number"), t.param("quantity", "number")),
  "xfunc2": t.func("number", t.param("price", "number"), t.param("quantity", "number", true)),
  "xDirection": "Direction",
  "xDirectionStr": "DirectionStr",
  "xDirUp": t.union(t.enumlit("Direction", "Up"), t.enumlit("Direction", "Left")),
  "xDirStrLeft": t.enumlit("DirectionStr", "Left"),
  "ximplicit": "any",
  "ximplicitFunc": t.func("number", t.param("price", "any")),
  "ximplicitFunc2": t.func("any", t.param("price", "any")),
});

const exportedTypeSuite: t.ITypeSuite = {
  ICacheItem,
  ILRUCache,
  MyType,
  NumberAlias,
  NumberAlias2,
  SomeEnum,
  Direction,
  DirectionStr,
  BooleanLikeHeterogeneousEnum,
  EnumComputed,