Skip to content

Usage Notes

CarlosOnline edited this page Sep 18, 2017 · 1 revision

PocoToTypescript Usage Notes

Preprocessing all files

All c# files are pre-processed in order to discover all types. This allows for tyescript files to reference the discovered types. Unknown types are emitted as any. This can be turned off with --skipPreprocess.

Using json input file

The --commands argument can point to a json file containing all the arguments. Sample json file below. Note that paths can be made relative to the working / current directory.

{
  "Files": [
    "..\\Providers\\Dto.cs",
    "..\\Providers\\ModelsFolder",
    "..\\Providers\\Streaming\\Models\\IDataObject.cs",
    "..\\Providers\\Folder2\\File.cs"
  ],
  "OutputFile": "typescript\\Combined.d.ts",
  "Namespace": "AlternateNameSpace",
  "Excluded": [
    "BaseClassObject",
    "IData"
  ],
  "ExcludedAttributes": [
    "JsonIgnore"
  ],
  "KnownTypes": [
    "T"
  ],
  "CommandFile": "typescript\\Combined.d.json",
  "SkipPreprocess": false,
  "Verbose": false,
  "Silent": false
}

Clone this wiki locally