Skip to content

Commit

Permalink
docs: restore the contents for createDtsBody()
Browse files Browse the repository at this point in the history
  • Loading branch information
Gumball12 committed Mar 10, 2024
1 parent da68df6 commit f6aa57f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,34 @@ type GenerateDtsFileOptions = Partial<{

To create a custom parser, see the [Writing a custom parser](./src/parser/README.md#writing-a-custom-parser) section.

### `createDtsBody`

```ts
function createDtsBody(
name: string,
object: object,
options?: CreateDtsOptions,
): string;

type CreateDtsOptions = Partial<{
defaultType: string;
importTypes: Import[];
}>;

type Import = {
name: string;
from: string;
};
```

- `name`: Name of the type.
- `object`: Content for the types.
- `options`
- `defaultType`: Type to use when the sheet type is an empty string, `undefined`, or `null`. Default is `any`.
- `importTypes`: Types to import from inside the file.
- `name`: Name of the type to import.
- `from`: File path to import the type from.

## License

[MIT](./LICENSE) @Gumball12

0 comments on commit f6aa57f

Please sign in to comment.