mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
remove docx-templates (#43864)
* remove docx-templates * Update notNeededPackages.json
This commit is contained in:
parent
8667a2c4fd
commit
2594f92015
@ -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",
|
||||
|
||||
@ -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,
|
||||
});
|
||||
40
types/docx-templates/index.d.ts
vendored
40
types/docx-templates/index.d.ts
vendored
@ -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;
|
||||
@ -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"]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user