@ovotech/ts-compose
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -25,3 +25,3 @@ import * as ts from 'typescript'; | ||
export declare const Private: (isPrivate?: boolean | undefined) => ts.Token<ts.SyntaxKind.PrivateKeyword>[]; | ||
export declare const Export: (isExport?: boolean | undefined) => ts.Token<ts.SyntaxKind.ExportKeyword>[]; | ||
export declare const Export: (isExport?: boolean | undefined, isDefault?: boolean | undefined) => ts.Token<ts.SyntaxKind.DefaultKeyword | ts.SyntaxKind.ExportKeyword>[]; | ||
export declare const Protected: (isProtected?: boolean | undefined) => ts.Token<ts.SyntaxKind.ProtectedKeyword>[]; | ||
@@ -62,6 +62,7 @@ export declare const Prop: ({ name, type, initializer, isReadonly, isOptional, isPublic, isPrivate, isProtected, jsDoc, }: { | ||
}) => ts.ExpressionWithTypeArguments; | ||
export declare const Alias: ({ name, type, typeArgs, isExport, jsDoc, }: { | ||
export declare const Alias: ({ name, type, typeArgs, isExport, isDefault, jsDoc, }: { | ||
name: string | ts.Identifier; | ||
type: ts.TypeNode; | ||
isExport?: boolean | undefined; | ||
isDefault?: boolean | undefined; | ||
typeArgs?: ts.TypeParameterDeclaration[] | undefined; | ||
@@ -74,3 +75,3 @@ jsDoc?: string | undefined; | ||
} | ||
export declare const Interface: ({ name, props, index, typeArgs, ext, isExport, jsDoc, }: { | ||
export declare const Interface: ({ name, props, index, typeArgs, ext, isExport, isDefault, jsDoc, }: { | ||
name: string | ts.Identifier; | ||
@@ -82,3 +83,4 @@ props?: ts.TypeElement[] | undefined; | ||
isExport?: boolean | undefined; | ||
isDefault?: boolean | undefined; | ||
jsDoc?: string | undefined; | ||
}) => ts.InterfaceDeclaration; |
@@ -46,3 +46,6 @@ "use strict"; | ||
exports.Private = (isPrivate) => isPrivate ? [ts.createModifier(ts.SyntaxKind.PrivateKeyword)] : []; | ||
exports.Export = (isExport) => isExport ? [ts.createModifier(ts.SyntaxKind.ExportKeyword)] : []; | ||
exports.Export = (isExport, isDefault) => [ | ||
...(isExport ? [ts.createModifier(ts.SyntaxKind.ExportKeyword)] : []), | ||
...(isDefault ? [ts.createModifier(ts.SyntaxKind.DefaultKeyword)] : []), | ||
]; | ||
exports.Protected = (isProtected) => isProtected ? [ts.createModifier(ts.SyntaxKind.ProtectedKeyword)] : []; | ||
@@ -61,5 +64,5 @@ exports.Prop = ({ name, type, initializer, isReadonly, isOptional, isPublic, isPrivate, isProtected, jsDoc, }) => docs_1.withJSDoc(ts.createPropertySignature([ | ||
exports.TypeExpression = ({ name, types, }) => ts.createExpressionWithTypeArguments(types, typeof name === 'string' ? ts.createIdentifier(name) : name); | ||
exports.Alias = ({ name, type, typeArgs, isExport, jsDoc, }) => docs_1.withJSDoc(ts.createTypeAliasDeclaration(undefined, exports.Export(isExport), name, typeArgs, type), jsDoc); | ||
exports.Interface = ({ name, props = [], index, typeArgs, ext, isExport, jsDoc, }) => docs_1.withJSDoc(ts.createInterfaceDeclaration(undefined, exports.Export(isExport), name, typeArgs, ext | ||
exports.Alias = ({ name, type, typeArgs, isExport, isDefault, jsDoc, }) => docs_1.withJSDoc(ts.createTypeAliasDeclaration(undefined, exports.Export(isExport, isDefault), name, typeArgs, type), jsDoc); | ||
exports.Interface = ({ name, props = [], index, typeArgs, ext, isExport, isDefault, jsDoc, }) => docs_1.withJSDoc(ts.createInterfaceDeclaration(undefined, exports.Export(isExport, isDefault), name, typeArgs, ext | ||
? [ts.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, ext.map(exports.TypeExpression))] | ||
: undefined, [...props, ...(index ? [index] : [])]), jsDoc); |
{ | ||
"name": "@ovotech/ts-compose", | ||
"description": "An ts compiler api wrapper", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"main": "dist/index.js", | ||
@@ -33,3 +33,3 @@ "types": "dist/index.d.ts", | ||
}, | ||
"gitHead": "1633c63cd1189341453bad0f6c52ef4bd76a8ed9" | ||
"gitHead": "e265608cf423dfea10e201867f85a58a2f5d3b74" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17031
274