We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { TypescriptParser } from 'typescript-parser'; const json = (data: any): string => JSON.stringify(data, null, ' '); async function main() { const timerToPreventFreeze = setTimeout(() => {}, 999999); const parser = new TypescriptParser(); console.log('# interface'); console.log(); console.log(json(await parser.parseSource(` interface A { n: number; s: string; } `))); console.log(); console.log('# type'); console.log(); console.log(json(await parser.parseSource(` type A = { n: number; s: string; } `))); clearTimeout(timerToPreventFreeze); } main().then(() => { process.exit() });
# interface { "filePath": "inline.tsx", "rootPath": "/", "start": 9, "end": 83, "imports": [], "exports": [], "declarations": [ { "name": "A", "isExported": false, "start": 9, "end": 78, "accessors": [], "properties": [ { "name": "n", "visibility": 2, "type": "number", "isOptional": false, "isStatic": false, "start": 35, "end": 45 }, { "name": "s", "visibility": 2, "type": "string", "isOptional": false, "isStatic": false, "start": 58, "end": 68 } ], "methods": [] } ], "resources": [], "usages": [ "n", "s" ] } # type { "filePath": "inline.tsx", "rootPath": "/", "start": 9, "end": 80, "imports": [], "exports": [], "declarations": [ { "name": "A", "isExported": false, "start": 9, "end": 75 } ], "resources": [], "usages": [ "n", "s" ] }
The text was updated successfully, but these errors were encountered:
Also no nested type declarations supported
Sorry, something went wrong.
No branches or pull requests
script
Result
The text was updated successfully, but these errors were encountered: