Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
599 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Definition } from "../Schema/Definition"; | ||
import { SubTypeFormatter } from "../SubTypeFormatter"; | ||
import { BaseType } from "../Type/BaseType"; | ||
import { FunctionType } from "../Type/FunctionType"; | ||
|
||
export class FunctionTypeFormatter implements SubTypeFormatter { | ||
public supportsType(type: FunctionType): boolean { | ||
return type instanceof FunctionType; | ||
} | ||
|
||
public getDefinition(type: FunctionType): Definition { | ||
// Return a custom schema for the function property. | ||
return { | ||
type: "object", | ||
properties: { | ||
isFunction: { | ||
type: "boolean", | ||
const: true, | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
// If this type does NOT HAVE children, generally all you need is: | ||
public getChildren(type: FunctionType): BaseType[] { | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { ConnectionOptions } from "node:tls"; | ||
|
||
export interface Test extends ConnectionOptions {} |
Oops, something went wrong.