mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #22266 from broder/cordova-univeral-links-plugin
Add typings for cordova-universal-links-plugin
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const newsEventname = 'openNewsListPage';
|
||||
universalLinks.subscribe(newsEventname, onNewsListPageRequested);
|
||||
|
||||
function onNewsListPageRequested(eventData: universalLinks.EventData) {
|
||||
alert('Did launch application with news link: ' + eventData.url);
|
||||
}
|
||||
|
||||
universalLinks.unsubscribe('openNewsListPage');
|
||||
|
||||
universalLinks.subscribe(null, onOtherLinkRequested);
|
||||
|
||||
function onOtherLinkRequested(eventData: universalLinks.EventData) {
|
||||
alert('Did launch application with other link: ' + eventData.url);
|
||||
}
|
||||
|
||||
universalLinks.unsubscribe(null);
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for cordova-universal-links-plugin 1.2
|
||||
// Project: https://github.com/nordnet/cordova-universal-links-plugin#readme
|
||||
// Definitions by: David Broder-Rodgers <https://github.com/broder>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace universalLinks {
|
||||
function subscribe(eventName: string | null, callback: (data: EventData) => void): void;
|
||||
function unsubscribe(eventName: string | null): void;
|
||||
|
||||
interface EventData {
|
||||
url: string;
|
||||
scheme: string;
|
||||
host: string;
|
||||
path: string;
|
||||
params: { [key: string]: string };
|
||||
hash: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cordova-universal-links-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user