diff --git a/notNeededPackages.json b/notNeededPackages.json index 464ad97ce2..35b1eabb06 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -990,6 +990,12 @@ "sourceRepoURL": "https://github.com/jonathantneal/document-promises#readme", "asOfVersion": "4.0.0" }, + { + "libraryName": "docx-templates", + "typingsPackageName": "docx-templates", + "sourceRepoURL": "https://github.com/guigrpa/docx-templates", + "asOfVersion": "4.0.0" + }, { "libraryName": "dom-helpers", "typingsPackageName": "dom-helpers", diff --git a/types/docx-templates/docx-templates-tests.ts b/types/docx-templates/docx-templates-tests.ts deleted file mode 100644 index 66155067ad..0000000000 --- a/types/docx-templates/docx-templates-tests.ts +++ /dev/null @@ -1,43 +0,0 @@ -import createReport from 'docx-templates'; - -createReport({ - template: 'templates/myTemplate.docx', - output: 'reports/myReport.docx', - data: { - name: 'John', - surname: 'Appleseed', - }, -}); - -createReport({ - template: 'templates/myTemplate.docx', - output: 'reports/myReport.docx', - data: (query: string) => JSON.parse(query), -}); - -async function test() { - const buffer1: Buffer = await createReport({ - output: 'buffer', - template: 'templates/myTemplate.docx', - data: {}, - }); - - const buffer2 = await createReport({ - output: 'buffer', - template: buffer1, - data: {}, - }); -} - -createReport({ - template: 'templates/myTemplate.docx', - output: 'reports/myReport.docx', - additionalJsContext: { - foo: 'bar', - qrCode: async (url: string) => {}, - }, - cmdDelimiter: '+++', - literalXmlDelimiter: '||', - processLineBreaks: true, - noSandbox: false, -}); diff --git a/types/docx-templates/index.d.ts b/types/docx-templates/index.d.ts deleted file mode 100644 index 1ba736980c..0000000000 --- a/types/docx-templates/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Type definitions for docx-templates 3.1 -// Project: https://github.com/guigrpa/docx-templates#readme -// Definitions by: Sebastian Krüger -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -declare function createReport(options: UserOptions<'buffer'>): Promise; -declare function createReport(options: UserOptions): Promise; - -interface runJSOptions { - sandbox: any; - ctx: any; -} - -interface UserOptions { - template: string | ArrayBuffer | Buffer; - data?: ReportData | QueryResolver; - queryVars?: any; - output?: T; - cmdDelimiter?: string | [string, string]; - literalXmlDelimiter?: string; - processLineBreaks?: boolean; - noSandbox?: boolean; - runJs?: ( - runJSOptions: runJSOptions, - ) => { - modifiedSandbox: any; - result: any; - }; - additionalJsContext?: any; - _probe?: 'JS' | 'XML'; -} - -type Query = string; - -type QueryResolver = (query?: Query, queryVars?: any) => ReportData | Promise; - -type ReportData = any; - -export default createReport; diff --git a/types/docx-templates/tsconfig.json b/types/docx-templates/tsconfig.json deleted file mode 100644 index 7d32f5f32c..0000000000 --- a/types/docx-templates/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": ["index.d.ts", "docx-templates-tests.ts"] -} diff --git a/types/docx-templates/tslint.json b/types/docx-templates/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/docx-templates/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }