@shanzhai/convert-json-to-type-script-step
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

@shanzhai/convert-json-to-type-script-step Continuous Integration License FOSSA Status Renovate enabled npm npm type definitions

A Shanzhai step which converts a JSON value to TypeScript source code for ambient declarations.

Usage

Use ConvertJsonToTypeScriptStep to convert an object containing constants into a set of TypeScript type declarations. For example, returning the following from a trigger's event handler:

new ConvertJsonToTypeScriptStep(
  `A description of the operation being performed`,
  new ConstantInput({
    theFirstDeclaration: 3,
    theSecondDeclaration: {
      anObjectContaining: [
        `an`,
        `array`,
      ],
    }
  })
);

To produce the following output:

declare const theFirstDeclaration: 3;

declare const theSecondDeclaration: {
  readonly anObjectContaining: readonly [
    `an`,
    `array`,
  ],
};

The values are not included; these should be injected during minification.

Dependencies

This package has no runtime dependencies.

Peer Dependencies

This package has no runtime peer dependencies (it does not expect any other packages to be installed alongside itself).

License

FOSSA Status

Readme

Keywords

none

Package Sidebar

Install

npm i @shanzhai/convert-json-to-type-script-step

Weekly Downloads

0

Version

0.0.11

License

MIT

Unpacked Size

6.88 kB

Total Files

5

Last publish

Collaborators

  • jameswilddev