mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add package: openurl & openurl2 (#40065)
* add package: openurl & openurl2 * fix lint
This commit is contained in:
parent
144b45d7c1
commit
2e2227cdde
9
types/openurl/index.d.ts
vendored
Normal file
9
types/openurl/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for openurl 1.0
|
||||
// Project: https://github.com/rauschma/openurl
|
||||
// Definitions by: Felix Hao <https://github.com/felixhao28>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
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;
|
||||
8
types/openurl/openurl-tests.ts
Normal file
8
types/openurl/openurl-tests.ts
Normal file
@ -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" }
|
||||
);
|
||||
23
types/openurl/tsconfig.json
Normal file
23
types/openurl/tsconfig.json
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
3
types/openurl/tslint.json
Normal file
3
types/openurl/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
9
types/openurl2/index.d.ts
vendored
Normal file
9
types/openurl2/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for openurl2 1.0
|
||||
// Project: https://github.com/rauschma/openurl
|
||||
// Definitions by: Felix Hao <https://github.com/felixhao28>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
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;
|
||||
8
types/openurl2/openurl2-tests.ts
Normal file
8
types/openurl2/openurl2-tests.ts
Normal file
@ -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" }
|
||||
);
|
||||
23
types/openurl2/tsconfig.json
Normal file
23
types/openurl2/tsconfig.json
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
3
types/openurl2/tslint.json
Normal file
3
types/openurl2/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user