remove docx-templates (#43864)

* remove docx-templates

* Update notNeededPackages.json
This commit is contained in:
Sebastian Krüger 2020-04-15 05:30:38 +02:00 committed by GitHub
parent 8667a2c4fd
commit 2594f92015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 104 deletions

View File

@ -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",

View File

@ -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,
});

View File

@ -1,40 +0,0 @@
// Type definitions for docx-templates 3.1
// Project: https://github.com/guigrpa/docx-templates#readme
// Definitions by: Sebastian Krüger <https://github.com/mathe42>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare function createReport(options: UserOptions<'buffer'>): Promise<Buffer>;
declare function createReport(options: UserOptions<string>): Promise<void>;
interface runJSOptions {
sandbox: any;
ctx: any;
}
interface UserOptions<T> {
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<ReportData>;
type ReportData = any;
export default createReport;

View File

@ -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"]
}

View File

@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }