Skip to content

Commit

Permalink
chore: update dts-buddy and doc generate
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikg committed Jun 27, 2024
1 parent 1fc3257 commit 564a98c
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 48 deletions.
22 changes: 11 additions & 11 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @param options - options
* @returns absolute path to closest tsconfig.json or null if not found
*/
export function find(filename: string, options?: TSConfckFindOptions | undefined): Promise<string | null>;
function find(filename: string, options?: TSConfckFindOptions | undefined): Promise<string | null>;
```

#### TSConfckFindOptions
Expand Down Expand Up @@ -61,7 +61,7 @@ interface TSConfckFindOptions {
* @param filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd)
* @param options - options
* */
export function parse(filename: string, options?: TSConfckParseOptions | undefined): Promise<TSConfckParseResult>;
function parse(filename: string, options?: TSConfckParseOptions | undefined): Promise<TSConfckParseResult>;
```

#### TSConfckParseOptions
Expand Down Expand Up @@ -108,7 +108,7 @@ interface TSConfckParseResult {
#### TSConfckParseError

```ts
export class TSConfckParseError extends Error {
class TSConfckParseError extends Error {
/**
*
* @param message - error message
Expand Down Expand Up @@ -144,7 +144,7 @@ export class TSConfckParseError extends Error {
* @param options - options
* @returns absolute path to closest tsconfig.json
*/
export function findNative(filename: string, options?: TSConfckFindOptions | undefined): Promise<string>;
function findNative(filename: string, options?: TSConfckFindOptions | undefined): Promise<string>;
```

### parseNative
Expand All @@ -158,7 +158,7 @@ export function findNative(filename: string, options?: TSConfckFindOptions | und
* @param filename - path to a tsconfig .json or a source file (absolute or relative to cwd)
* @param options - options
* */
export function parseNative(filename: string, options?: TSConfckParseNativeOptions | undefined): Promise<TSConfckParseNativeResult>;
function parseNative(filename: string, options?: TSConfckParseNativeOptions | undefined): Promise<TSConfckParseNativeResult>;
```

#### TSConfckParseNativeOptions
Expand Down Expand Up @@ -211,22 +211,22 @@ interface TSConfckParseNativeResult {
#### TSConfckParseNativeError

```ts
export class TSConfckParseNativeError extends Error {
class TSConfckParseNativeError extends Error {
/**
*
* @param diagnostic - diagnostics of ts
* @param tsconfigFile - file that errored
* @param result - parsed result, if any
*/
constructor(diagnostic: any, tsconfigFile: string, result: any | null);
constructor(diagnostic: TSDiagnosticError, tsconfigFile: string, result: any | null);
/**
* code of typescript diagnostic, prefixed with "TS "
* */
code: string;
/**
* full ts diagnostic that caused this error
* */
diagnostic: any;
diagnostic: TSDiagnosticError;
/**
* native result if present, contains all errors in result.errors
* */
Expand All @@ -248,7 +248,7 @@ export class TSConfckParseNativeError extends Error {
* @param options - options
* @returns list of absolute paths to all found tsconfig.json files
*/
export function findAll(dir: string, options?: TSConfckFindAllOptions | undefined): Promise<string[]>;
function findAll(dir: string, options?: TSConfckFindAllOptions | undefined): Promise<string[]>;
```

#### TSConfckFindAllOptions
Expand Down Expand Up @@ -279,13 +279,13 @@ interface TSConfckFindAllOptions {
* @param tsconfigJson - content of tsconfig.json
* @returns content as regular json, comments and dangling commas have been replaced with whitespace
*/
export function toJson(tsconfigJson: string): string;
function toJson(tsconfigJson: string): string;
```

### TSConfckCache

```ts
export class TSConfckCache<T> {
class TSConfckCache<T> {
/**
* clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@changesets/cli": "^2.27.5",
"@eslint/js": "^9.4.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"dts-buddy": "^0.4.7",
"dts-buddy": "^0.5.0",
"esbuild": "^0.21.5",
"eslint": "^9.4.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
33 changes: 22 additions & 11 deletions packages/tsconfck/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ declare module 'tsconfck' {
* @param options - options
* @returns absolute path to closest tsconfig.json or null if not found
*/
export function find(filename: string, options?: TSConfckFindOptions | undefined): Promise<string | null>;
function find(filename: string, options?: TSConfckFindOptions | undefined): Promise<string | null>;
/**
* find all tsconfig.json files in dir
*
* @param dir - path to dir (absolute or relative to cwd)
* @param options - options
* @returns list of absolute paths to all found tsconfig.json files
*/
export function findAll(dir: string, options?: TSConfckFindAllOptions | undefined): Promise<string[]>;
function findAll(dir: string, options?: TSConfckFindAllOptions | undefined): Promise<string[]>;
/**
* convert content of tsconfig.json to regular json
*
* @param tsconfigJson - content of tsconfig.json
* @returns content as regular json, comments and dangling commas have been replaced with whitespace
*/
export function toJson(tsconfigJson: string): string;
function toJson(tsconfigJson: string): string;
/**
* find the closest tsconfig.json file using native ts.findConfigFile
*
Expand All @@ -31,8 +31,8 @@ declare module 'tsconfck' {
* @param options - options
* @returns absolute path to closest tsconfig.json
*/
export function findNative(filename: string, options?: TSConfckFindOptions | undefined): Promise<string>;
export class TSConfckCache<T> {
function findNative(filename: string, options?: TSConfckFindOptions | undefined): Promise<string>;
class TSConfckCache<T> {
/**
* clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted
*/
Expand Down Expand Up @@ -69,8 +69,8 @@ declare module 'tsconfck' {
* @param filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd)
* @param options - options
* */
export function parse(filename: string, options?: TSConfckParseOptions | undefined): Promise<TSConfckParseResult>;
export class TSConfckParseError extends Error {
function parse(filename: string, options?: TSConfckParseOptions | undefined): Promise<TSConfckParseResult>;
class TSConfckParseError extends Error {
/**
*
* @param message - error message
Expand Down Expand Up @@ -100,23 +100,23 @@ declare module 'tsconfck' {
* @param filename - path to a tsconfig .json or a source file (absolute or relative to cwd)
* @param options - options
* */
export function parseNative(filename: string, options?: TSConfckParseNativeOptions | undefined): Promise<TSConfckParseNativeResult>;
export class TSConfckParseNativeError extends Error {
function parseNative(filename: string, options?: TSConfckParseNativeOptions | undefined): Promise<TSConfckParseNativeResult>;
class TSConfckParseNativeError extends Error {
/**
*
* @param diagnostic - diagnostics of ts
* @param tsconfigFile - file that errored
* @param result - parsed result, if any
*/
constructor(diagnostic: any, tsconfigFile: string, result: any | null);
constructor(diagnostic: TSDiagnosticError, tsconfigFile: string, result: any | null);
/**
* code of typescript diagnostic, prefixed with "TS "
* */
code: string;
/**
* full ts diagnostic that caused this error
* */
diagnostic: any;
diagnostic: TSDiagnosticError;
/**
* native result if present, contains all errors in result.errors
* */
Expand All @@ -126,6 +126,15 @@ declare module 'tsconfck' {
* */
tsconfigFile: string;
}
/**
* {
* code: number;
* category: number;
* messageText: string;
* start?: number;
* } TSDiagnosticError
*/
type TSDiagnosticError = any;
interface TSConfckFindOptions {
/**
* A cache to improve performance for multiple calls in the same project
Expand Down Expand Up @@ -246,6 +255,8 @@ declare module 'tsconfck' {
*/
result: any;
}

export { find, findAll, toJson, findNative, TSConfckCache, parse, TSConfckParseError, parseNative, TSConfckParseNativeError };
}

//# sourceMappingURL=index.d.ts.map
6 changes: 5 additions & 1 deletion packages/tsconfck/types/index.d.ts.map
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"TSConfckParseError",
"parseNative",
"TSConfckParseNativeError",
"TSDiagnosticError",
"TSConfckFindOptions",
"TSConfckParseOptions",
"TSConfckFindAllOptions",
Expand All @@ -26,6 +27,7 @@
"../src/cache.js",
"../src/parse.js",
"../src/parse-native.js",
"../src/parse-native.d.ts",
"../src/public.d.ts"
],
"sourcesContent": [
Expand All @@ -36,7 +38,9 @@
null,
null,
null,
null,
null
],
"mappings": ";;;;;;;;iBAUsBA,IAAIA;;;;;;;;iBCYJC,OAAOA;;;;;;;iBCTbC,MAAMA;;;;;;;;;;iBCDAC,UAAUA;cCXnBC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC2BJC,KAAKA;cA6VdC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC7VTC,WAAWA;cAkOpBC,wBAAwBA;;;;;;;;;;;;;;;;;;;;;;;;;WC5PpBC,mBAAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCnBC,oBAAoBA;;;;WAIpBC,sBAAsBA;;;;;;;;;;;;;;;WAetBC,mBAAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BnBC,0BAA0BA;;;;;;;;;;;;WAY1BC,yBAAyBA"
"mappings": ";;;;;;;;UAUsBA,IAAIA;;;;;;;;UCYJC,OAAOA;;;;;;;UCTbC,MAAMA;;;;;;;;;;UCDAC,UAAUA;OCXnBC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC2BJC,KAAKA;OA6VdC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UC7VTC,WAAWA;OAkOpBC,wBAAwBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MC9MzBC,iBAAiBA;WC9CZC,mBAAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCnBC,oBAAoBA;;;;WAIpBC,sBAAsBA;;;;;;;;;;;;;;;WAetBC,mBAAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BnBC,0BAA0BA;;;;;;;;;;;;WAY1BC,yBAAyBA",
"ignoreList": []
}
Loading

0 comments on commit 564a98c

Please sign in to comment.