mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added typing for xml-c14n (#38634)
* added xml-c14n typing * reworked tests; added test run to package.json * formatting fix * removed package.json * added info * fixed errors * rewrote typing * reworked version * added compile flag * corrected export * corrected export * corrected tsconfig * set noImplicitAny to false * set other options to false * returned back options which were turned off by mistake * fixed typing according to review comment
This commit is contained in:
parent
21da200696
commit
97c71bc7cb
31
types/xml-c14n/index.d.ts
vendored
Normal file
31
types/xml-c14n/index.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Type definitions for xml-c14n 0.0
|
||||
// Project: https://github.com/deoxxa/xml-c14n
|
||||
// Definitions by: Konstantin Yuriev <https://github.com/gallowsmaker>
|
||||
// Max Boguslavskiy <https://github.com/maxbogus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
declare namespace xml_c14n {
|
||||
type canonicaliseCb = (err: any, data: string) => void;
|
||||
|
||||
interface Options {
|
||||
includeComments?: boolean;
|
||||
inclusiveNamespaces?: boolean;
|
||||
}
|
||||
|
||||
interface Canonicalize {
|
||||
name(): string;
|
||||
_processInner(node: Node): string;
|
||||
canonicalise(node: Node, cb: canonicaliseCb): void;
|
||||
}
|
||||
|
||||
interface CanonizationFactory {
|
||||
createCanonicaliser(kind: string, options?: Options): Canonicalize;
|
||||
getAlgorithm(uri: string): any;
|
||||
registerAlgorithm(uri: string, implementation: any): any;
|
||||
}
|
||||
}
|
||||
|
||||
declare function xml_c14n(): xml_c14n.CanonizationFactory;
|
||||
|
||||
export = xml_c14n;
|
||||
25
types/xml-c14n/tsconfig.json
Normal file
25
types/xml-c14n/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"xml-c14n-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/xml-c14n/tslint.json
Normal file
1
types/xml-c14n/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
5
types/xml-c14n/xml-c14n-tests.ts
Normal file
5
types/xml-c14n/xml-c14n-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import c14n from 'xml-c14n';
|
||||
|
||||
const canonizer = c14n().createCanonicaliser(
|
||||
'http://www.w3.org/2001/10/xml-exc-c14n#',
|
||||
);
|
||||
Loading…
Reference in New Issue
Block a user