tsdk Snippets
When we run tsdk --init
or tsdk --sync
, will generate .vscode/tsdk.code-snippets
file in the root directory.
Snippets can help us generate API config quickly.
Currently, include 2 snippets:
- apii generate the import
- apic generate the config
Video
Generate the import line use apii
import { transformPath, APIConfig, ObjectLiteral } from '@/src/shared/tsdk-helper';
Generate config use apic
Press tab
can eaisly move cursor to the next step
/**
* description ({@link APIConfig})
* @category Category
*/
export const ApiNameConfig: APIConfig = {
type: 'user',
method: 'get',
path: transformPath('ApiName'),
description: 'description',
category: 'Category',
};
/**
*
* @category Category
*/
export type ApiNameReq = {};
/**
*
* @category Category
*/
export type ApiNameRes = {};
// --------- ApiName END ---------