diff --git a/types/openurl/index.d.ts b/types/openurl/index.d.ts new file mode 100644 index 0000000000..0e8ba25438 --- /dev/null +++ b/types/openurl/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for openurl 1.0 +// Project: https://github.com/rauschma/openurl +// Definitions by: Felix Hao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export function open(url: string, callback?: (err: Error) => void): void; +export function mailto(recipients: string[], fields: {[key: string]: string}, recipientsSeparator?: string, callback?: (err: Error) => void): void; diff --git a/types/openurl/openurl-tests.ts b/types/openurl/openurl-tests.ts new file mode 100644 index 0000000000..ecfc56e72d --- /dev/null +++ b/types/openurl/openurl-tests.ts @@ -0,0 +1,8 @@ +import { open, mailto } from "openurl"; +open("http://rauschma.de", (e) => { + console.log(e.message); +}); +mailto( + ["john@example.com", "jane@example.com"], + { subject: "Hello!", body: "This is\nan automatically sent email!\n" } +); diff --git a/types/openurl/tsconfig.json b/types/openurl/tsconfig.json new file mode 100644 index 0000000000..320f63b662 --- /dev/null +++ b/types/openurl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "index.d.ts", + "openurl-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/openurl/tslint.json b/types/openurl/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/openurl/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/openurl2/index.d.ts b/types/openurl2/index.d.ts new file mode 100644 index 0000000000..e455c3cdb6 --- /dev/null +++ b/types/openurl2/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for openurl2 1.0 +// Project: https://github.com/rauschma/openurl +// Definitions by: Felix Hao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export function open(url: string, callback?: (err: Error) => void): void; +export function mailto(recipients: string[], fields: {[key: string]: string}, recipientsSeparator?: string, callback?: (err: Error) => void): void; diff --git a/types/openurl2/openurl2-tests.ts b/types/openurl2/openurl2-tests.ts new file mode 100644 index 0000000000..dc4145e9b2 --- /dev/null +++ b/types/openurl2/openurl2-tests.ts @@ -0,0 +1,8 @@ +import { open, mailto } from "openurl2"; +open("http://rauschma.de", (e) => { + console.log(e.message); +}); +mailto( + ["john@example.com", "jane@example.com"], + { subject: "Hello!", body: "This is\nan automatically sent email!\n" } +); diff --git a/types/openurl2/tsconfig.json b/types/openurl2/tsconfig.json new file mode 100644 index 0000000000..596e3c4992 --- /dev/null +++ b/types/openurl2/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "index.d.ts", + "openurl2-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/openurl2/tslint.json b/types/openurl2/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/openurl2/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}