Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>vscode-ecar-code-generatorNew to Visual Studio Code? Get it now.
vscode-ecar-code-generator

vscode-ecar-code-generator

MapleImage

|
29 installs
| (1) | Free
根据接口类型定义生成代码
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-code-generator

generate code from ts interface

json to ts

fork from https://github.com/MariusAlch/json-to-ts

input

{
  "cats": [
    {"name": "Kittin"},
    {"name": "Mittin"}
  ],
  "favoriteNumber": 42,
  "favoriteWord": "Hello"
}

ouput

interface RootObject {
  cats: Cat[];
  favoriteNumber: number;
  favoriteWord: string;
}
interface Cat {
  name: string;
}

ts to scheam code

input

interface RootObject {
  cats: string;
  favoriteNumber: number;
  favoriteWord: string;
}

output

特定业务下的schema代码

export const columns: BasicColumn<>[] = [
  // ...
]
export const searchFormSchema: FormSchema<>[] = [
  // ...
]
export const formSchema: FormSchema<>[] = [
  // ...
]

build

npm run package

publish

需要提前注册vscode extension publisher的角色,参考#[1]

npm run publish

链接

    1. publishing-extension
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft