diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 86b77f8c6b..2d28d19f8c 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1104,6 +1104,7 @@
/types/ffprobe-static/ @iamstevetran
/types/fhir-js-client/ @rmchndrng
/types/fibers/ @soywiz
+/types/fibjs/ @richardo2016
/types/figures/ @BendingBender
/types/file-exists/ @BendingBender
/types/file-saver/ @cyrilschumacher @DaIgeb @chrismbarr
@@ -3383,7 +3384,7 @@
/types/react-json/ @spielc
/types/react-json-pretty/ @LKay
/types/react-json-tree/ @gnestor
-/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston
+/types/react-jsonschema-form/ @iamdanfox @iplus26 @KurtPreston
/types/react-lazyload/ @m0a
/types/react-leaflet/ @danzel @davschne @yuit
/types/react-list/ @buptyyf @tomshen
diff --git a/README.md b/README.md
index 8e582f05b4..34eae06069 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ Before you share your improvement with the world, use it yourself.
#### Test editing an existing package
-To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html).
+To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation).
You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below.
diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts
index 828aab87c2..7faa5da4f8 100644
--- a/types/ace/index.d.ts
+++ b/types/ace/index.d.ts
@@ -832,8 +832,9 @@ declare namespace AceAjax {
/**
* [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
+ * @param scrollLeft The new scroll left value
**/
- setScrollLeft(): void;
+ setScrollLeft(scrollLeft: number): void;
/**
* [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
diff --git a/types/ace/test/edit_session.ts b/types/ace/test/edit_session.ts
index 4713495f7a..29b3bb6bd8 100644
--- a/types/ace/test/edit_session.ts
+++ b/types/ace/test/edit_session.ts
@@ -18,6 +18,23 @@ function createFoldTestSession() {
return session;
}
+function createScrollTestRenderer(): AceAjax.VirtualRenderer | null {
+ var el = document.createElement("div");
+
+ if (!el.getBoundingClientRect) {
+ console.log("Skipping test: This test only runs in the browser");
+ return null;
+ }
+
+ el.style.left = "20px";
+ el.style.top = "30px";
+ el.style.width = "300px";
+ el.style.height = "100px";
+ document.body.appendChild(el);
+
+ return new AceAjax.VirtualRenderer(el);
+}
+
function assertArray(a, b) {
assert.equal(a + "", b + "");
assert.ok(a.length == b.length);
@@ -915,5 +932,25 @@ const aceEditSessionTests = {
session = new AceAjax.EditSession(new Array(30).join("\n"));
session.documentToScreenPosition(2, 0);
session.documentToScreenPosition(2, 0);
+ },
+
+ "test setScrollTop()": function() {
+ var renderer = createScrollTestRenderer();
+ var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]);
+ renderer.setSession(session);
+ assert.equal(renderer.getScrollTop(), 0);
+ session.setScrollTop(40);
+ assert.equal(renderer.getScrollTop(), 40);
+ renderer.getScrollTop()
+ },
+
+ "test setScrollLeft()": function() {
+ var renderer = createScrollTestRenderer();
+ var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]);
+ renderer.setSession(session);
+ assert.equal(renderer.getScrollLeft(), 0);
+ session.setScrollLeft(40);
+ assert.equal(renderer.getScrollLeft(), 40);
+ renderer.getScrollLeft()
}
-};
\ No newline at end of file
+};
diff --git a/types/angular-gettext/index.d.ts b/types/angular-gettext/index.d.ts
index 107d9e10e2..5b6eb1d90f 100644
--- a/types/angular-gettext/index.d.ts
+++ b/types/angular-gettext/index.d.ts
@@ -9,6 +9,7 @@
import * as angular from 'angular';
+export type gettextCatalog = angular.gettext.gettextCatalog;
declare module 'angular' {
export namespace gettext {
diff --git a/types/angular-local-storage/index.d.ts b/types/angular-local-storage/index.d.ts
index 76ab65b1b5..6e8c64416a 100644
--- a/types/angular-local-storage/index.d.ts
+++ b/types/angular-local-storage/index.d.ts
@@ -8,6 +8,10 @@
import * as angular from 'angular';
+export type ILocalStorageServiceProvider = angular.local.storage.ILocalStorageServiceProvider;
+export type ILocalStorageService = angular.local.storage.ILocalStorageService;
+export type ICookie = angular.local.storage.ICookie;
+
declare module 'angular' {
export namespace local.storage {
interface ILocalStorageServiceProvider extends angular.IServiceProvider {
diff --git a/types/angular-mocks/angular-mocks-tests.ts b/types/angular-mocks/angular-mocks-tests.ts
index cabbf7c578..f04c9a2a30 100644
--- a/types/angular-mocks/angular-mocks-tests.ts
+++ b/types/angular-mocks/angular-mocks-tests.ts
@@ -1,70 +1,91 @@
-
///////////////////////////////////////
// IAngularStatic
///////////////////////////////////////
-var angular: ng.IAngularStatic;
-var mock: ng.IMockStatic;
+let angular: ng.IAngularStatic;
+let mock: ng.IMockStatic;
mock = angular.mock;
-
///////////////////////////////////////
// IMockStatic
///////////////////////////////////////
-var date: Date;
+let date: Date;
mock.dump({ key: 'value' });
mock.inject(
- function () { return 1; },
- function () { return 2; }
- );
+ function() {
+ return 1;
+ },
+ function() {
+ return 2;
+ }
+);
-mock.inject(
- ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]);
+mock.inject([
+ '$rootScope',
+ function($rootScope: ng.IRootScopeService) {
+ return 1;
+ }
+]);
// This overload is not documented on the website, but flows from
// how the injector works.
mock.inject(
- ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }],
- ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]);
+ [
+ '$rootScope',
+ function($rootScope: ng.IRootScopeService) {
+ return 1;
+ }
+ ],
+ [
+ '$rootScope',
+ function($rootScope: ng.IRootScopeService) {
+ return 2;
+ }
+ ]
+);
mock.module('module1', 'module2');
mock.module(
- function () { return 1; },
- function () { return 2; }
- );
-mock.module({ module1: function () { return 1; } });
+ function() {
+ return 1;
+ },
+ function() {
+ return 2;
+ }
+);
+mock.module({
+ module1: () => {
+ return 1;
+ }
+});
mock.module.sharedInjector();
date = mock.TzDate(-7, '2013-1-1T15:00:00Z');
date = mock.TzDate(-8, 12345678);
-
///////////////////////////////////////
// IExceptionHandlerProvider
///////////////////////////////////////
-var exceptionHandlerProvider: ng.IExceptionHandlerProvider;
+let exceptionHandlerProvider: ng.IExceptionHandlerProvider;
exceptionHandlerProvider.mode('log');
-
///////////////////////////////////////
// ITimeoutService
///////////////////////////////////////
-var timeoutService: ng.ITimeoutService;
+let timeoutService: ng.ITimeoutService;
timeoutService.flush();
timeoutService.flush(1234);
-timeoutService.flushNext();
-timeoutService.flushNext(1234);
timeoutService.verifyNoPendingTasks();
////////////////////////////////////////
// IIntervalService
////////////////////////////////////////
-var intervalService: ng.IIntervalService;
-var intervalServiceTimeActuallyAdvanced: number;
+let intervalService: ng.IIntervalService;
+let intervalServiceTimeActuallyAdvanced: number;
intervalServiceTimeActuallyAdvanced = intervalService.flush();
intervalServiceTimeActuallyAdvanced = intervalService.flush(1234);
@@ -72,9 +93,9 @@ intervalServiceTimeActuallyAdvanced = intervalService.flush(1234);
///////////////////////////////////////
// ILogService, ILogCall
///////////////////////////////////////
-var logService: ng.ILogService;
-var logCall: ng.ILogCall;
-var logs: string[];
+let logService: ng.ILogService;
+let logCall: ng.ILogCall;
+let logs: string[];
logService.assertEmpty();
logService.reset();
@@ -90,29 +111,31 @@ logs = logCall.logs;
///////////////////////////////////////
// ControllerService mock
///////////////////////////////////////
-var $controller: ng.IControllerService;
-$controller(class TestController {}, {}, {myBinding: 'works!'});
-$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'});
-$controller('TestController', {}, {myBinding: 'works!'});
-
+let $controller: ng.IControllerService;
+$controller(class TestController {}, {}, { myBinding: 'works!' });
+$controller(function TestController() {}, { someLocal: 42 }, { myBinding: 'works!' });
+$controller('TestController', {}, { myBinding: 'works!' });
///////////////////////////////////////
// IComponentControllerService
///////////////////////////////////////
-var $componentController: ng.IComponentControllerService;
-$componentController<{}, {}>('Test controller', { $scope: Clears browsing data for the webview partition. Injects JavaScript code into the guest page. The following sample code uses script injection to set the guest page's background color to red: The following example code navigates the webview to about:blank when the guest attempts to close itself. The following example code forwards all log messages to the embedder's console without regard for log level or other properties. The following example code modifies the default font size of the guest's body element after the page loads: Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.) The default behavior is to cancel the dialog. The following example code will show a farewell message whenever the guest page crashes: Note: When a resource load is aborted, a loadabort event will eventually be followed by a loadstop event, even if all committed loads since the last loadstop event (if any) were aborted. Note: When the load of either an about URL or a JavaScript URL is aborted, loadabort will be fired and then the webview will be navigated to 'about:blank'. Note: When a committed load is aborted, a loadstop event will eventually follow a loadabort event, even if all committed loads since the last loadstop event (if any) were aborted. The following example code will create and navigate a new webview in the embedder for each requested new window: The following example code will grant the guest page access to the webkitGetUserMedia API. Note that an app using this example code must itself specify audioCapture and/or videoCapture manifest permissions: The following example code will fade the webview element in or out as it becomes responsive or unresponsive: Posts a message to the embedded web content as long as the embedded content is displaying a page from the target origin. This method is available once the page has completed loading. Listen for the contentload event and then call the method. The guest will be able to send replies to the embedder by posting message to event.source on the message event it receives. This API is identical to the HTML5 postMessage API for communication between web pages. The embedder may listen for replies by adding a message event listener to its own frame. Posts a message to the embedded web content as long as the embedded content is displaying a page from the target origin. This method is available once the page has completed loading. Listen for the contentload event and then call the method. The guest will be able to send replies to the embedder by posting message to event.source on the message event it receives. This API is identical to the HTML5 postMessage API for communication between web pages. The embedder may listen for replies by adding a message event listener to its own frame. Describes a rectangle in screen coordinates. The containment semantics are array-like; that is, the coordinate (left, top) is considered to be contained by the rectangle, but the coordinate (left + width, top) is not. To illustrate how usage differs from the extensions webRequest API, consider the following example code which blocks any guest requests for URLs which match *://www.evil.com/*: Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events. See declarativeWebRequest for API details.webview and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see Usage).
+ * Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the webview and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see Usage).
*/
namespace webview {
/** Options that determine what data should be cleared by `clearData`. */
@@ -4611,7 +5493,7 @@ declare namespace chrome {
*/
interface InjectDetails {
/**
- * @description JavaScript or CSS code to inject.
Warning:
Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks.
+ * @description JavaScript or CSS code to inject.
Warning:
Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks.
* @type {string}
* @memberof InjectDetails
*/
@@ -4624,38 +5506,501 @@ declare namespace chrome {
file?: string
}
- interface WebViewElementEventMap {
- 'close': Event,
- 'consolemessage': IConsolemessage,
- 'contentload': Event,
- 'dialog': IDialog,
- 'exit': IExit,
- 'findupdate': IFindupdate,
- 'loadabort': ILoadabort,
- 'loadcommit': ILoadcommit,
- 'loadredirect': ILoadredirect,
- 'loadstart': ILoadstart,
- 'loadstop': Event,
- 'newwindow': INewwindow,
- 'permissionrequest': IPermissionrequest,
- 'responsive': IResponsive,
- 'sizechanged': ISizechanged,
- 'unresponsive': IUnresponsive,
- 'zoomchange': IZoomchange,
- }
-
-
/**
- * @description
- * @export
- * @interface HTMLWebViewElement
- * @extends {Element}
+ * @description WebView element from html
*/
interface HTMLWebViewElement extends Element {
- executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void;
+ /**
+ * This sets the guest content's window.name object.
+ */
+ name: string;
+ /**
+ * Returns the visible URL. Mirrors the logic in the browser's omnibox: either returning a pending new navigation if initiated by the embedder page, or the last committed navigation. Writing to this attribute initiates top-level navigation.
+ * Assigning src its own value will reload the current page.
+ * The src attribute cannot be cleared or removed once it has been set, unless the webview is removed from the DOM.
+ * The src attribute can also accept data URLs, such as 'data:text/plain,Hello, world!'.
+ */
src: string;
- contentWindow: Window;
- addEventListenerwebview.executeScript({ code: 'document.body.style.backgroundColor = 'red'' });
+ * @param details Details of the script to run.
+ * @param callback
+ */
+ executeScript(details: InjectDetails, callback?: (result?: any[]) => void): void;
+
+ /**
+ * @description Initiates a find-in-page request.
+ * @param {string} searchText The string to find in the page.
+ * @param options Options for the find request.
+ * @param callback
+ */
+ find(searchText: string, options?: FindOptions, callback?: (results?: any) => void): void;
+
+ /**
+ * @description Navigates forward one history entry if possible. Equivalent to go(1).
+ * @param callback
+ */
+ forward(callback?: (success: boolean) => void): void;
+
+ /**
+ * @description Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID.
+ */
+ getProcessId(): void;
+
+ /**
+ * @description Returns the user agent string used by the webview for guest page requests.
+ */
+ getUserAgent(): void;
+
+ /**
+ * @description Gets the current zoom factor.
+ * @param callback
+ */
+ getZoom(callback: (zoomFactor: number) => void): void;
+
+ /**
+ * @description Gets the current zoom mode.
+ * @param callback
+ */
+ getZoomMode(callback: (ZoomMode: any) => void): void;
+
+ /**
+ * @description Navigates to a history entry using a history index relative to the current navigation. If the requested navigation is impossible, this method has no effect.
+ * @param {number} relativeIndex Relative history index to which the webview should be navigated. For example, a value of 2 will navigate forward 2 history entries if possible; a value of -3 will navigate backward 3 entries.
+ * @param callback
+ */
+ go(relativeIndex: number, callback?: (success: boolean) => void): void;
+
+ /**
+ * @description Injects CSS into the guest page.
+ * @param details Details of the CSS to insert.
+ * @param callback
+ */
+ insertCSS(details: InjectDetails, callback?: () => void): void;
+
+ /**
+ * @description Indicates whether or not the webview's user agent string has been overridden by $(ref:webviewTag.setUserAgentOverride).
+ */
+ isUserAgentOverridden(): void;
+
+ /**
+ * @description Prints the contents of the webview. This is equivalent to calling scripted print function from the webview itself.
+ */
+ print(): void;
+
+ /**
+ * @description Reloads the current top-level page.
+ */
+ reload(): void;
+
+ /**
+ * @description Removes content scripts from a webview.
+ * @description The following example removes 'myRule' which was added before.
+ * @example webview.removeContentScripts(['myRule']);
+ * @description You can remove all the rules by calling:
+ * @example webview.removeContentScripts();
+ * @param {any[]} scriptNameList A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the webview will be removed.
+ */
+ removeContentScripts(scriptNameList?: any[]): void;
+
+ /**
+ * @description Override the user agent string used by the webview for guest page requests.
+ * @param {string} userAgent The user agent string to use.
+ */
+ setUserAgentOverride(userAgent: string): void;
+
+ /**
+ * @description Changes the zoom factor of the page. The scope and persistence of this change are determined by the webview's current zoom mode (see $(ref:webviewTag.ZoomMode)).
+ * @param {number} zoomFactor The new zoom factor.
+ * @param callback
+ */
+ setZoom(zoomFactor: number, callback?: () => void): void;
+
+ /**
+ * @description Sets the zoom mode of the webview.
+ * @param ZoomMode Defines how zooming is handled in the webview.
+ * @param callback
+ */
+ setZoomMode(ZoomMode: ZoomMode, callback?: () => void): void;
+
+ /**
+ * @description Stops loading the current webview navigation if in progress.
+ */
+ stop(): void;
+
+ /**
+ * @description Ends the current find session (clearing all highlighting) and cancels all find requests in progress.
+ * @param {string} action Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep.
+ */
+ stopFinding(action?: string): void;
+
+ /**
+ * @description Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL.
+ * @param {string} dataUrl The data URL to load.
+ * @param {string} baseUrl The base URL that will be used for relative links.
+ * @param {string} virtualUrl The URL that will be displayed to the user (in the address bar).
+ */
+ loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void;
+
+ /**
+ * @description Forcibly kills the guest web page's renderer process. This may affect multiple webview tags in the current app if they share the same process, but it will not affect webview tags in other apps.
+ */
+ terminate(): void;
+
+ /**
+ * @description Fired when the guest window attempts to close itself.webview.addEventListener('close', function() {
+ webview.src = 'about:blank';
+ });
+ */
+
+ close(event: chrome.events.Eventwebview.addEventListener('consolemessage', function(e) {
+ console.log('Guest page logged a message: ', e.message);
+ });
+ * @param callback
+ */
+
+ consolemessage: chrome.events.Eventwebview.addEventListener('contentload', function() {
+ webview.executeScript({ code: 'document.body.style.fontSize = '42px'' });
+ });
+ */
+
+ contentload: (event: chrome.events.Eventwebview.addEventListener('exit', function(e) {
+ if (e.reason === 'crash') {
+ webview.src = 'data:text/plain,Goodbye, world!';
+ }
+ });
+ * @param callback
+ */
+
+ exit: chrome.events.Eventwebview.addEventListener('newwindow', function(e) {
+ var newWebview = document.createElement('webview');
+ document.body.appendChild(newWebview);
+ e.window.attach(newWebview);
+ });
+ * @param callback
+ */
+
+ newwindow: chrome.events.Eventwebview.addEventListener('permissionrequest', function(e) {
+ if (e.permission === 'media') {
+ e.request.allow();
+ }
+ });
+ * @param callback
+ */
+
+ permissionrequest: chrome.events.Eventwebview.style.webkitTransition = 'opacity 250ms';
+ webview.addEventListener('unresponsive', function() {
+ webview.style.opacity = '0.5';
+ });
+ webview.addEventListener('responsive', function() {
+ webview.style.opacity = '1';
+ });
+ * @param callback
+ */
+
+ responsive: chrome.events.Eventwebview.request.onBeforeRequest.addListener(
- function(details) { return {cancel: true}; },
- {urls: ["*://www.evil.com/*"]},
- ["blocking"]);
var rule = {
- conditions: [
- new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } })
- ],
- actions: [ new chrome.webViewRequest.CancelRequest() ]
- };
- myWebview.request.onRequest.addRules([rule]); */
+ /**
+ * @description Interface which provides access to webRequest events on the guest page. See the chrome.webRequest extensions API for details on webRequest life cycle and related concepts.To illustrate how usage differs from the extensions webRequest API, consider the following example code which blocks any guest requests for URLs which match *://www.evil.com/*:
webview.request.onBeforeRequest.addListener(
+ * @example function(details) { return {cancel: true}; }, {urls: ['*://www.evil.com/*']}, ['blocking']);
+ * @description Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events.
+ * @see http://developer.chrome.com/extensions/declarativeWebRequest.htmldeclarativeWebRequest
+ * @description Note that conditions and actions for declarative webview webRequests should be instantiated from their chrome.webViewRequest.* counterparts. The following example code declaratively blocks all requests to 'example.com' on the webview myWebview:
+ * @example var rule = { conditions: [ new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } }) ], actions: [ new chrome.webViewRequest.CancelRequest() ] }; myWebview.request.onRequest.addRules([rule]);
+ **/
interface WebRequestEventInterface {
}
/**
* Defines the how zooming is handled in the webview.
* Enum values:
- * "per-origin"
+ * 'per-origin'
* * Zoom changes will persist in the zoomed page's origin, i.e. all other webviews in the same partition that are navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor.
- * "per-view"
+ * 'per-view'
* * Zoom changes only take effect in this webview, and zoom changes in other webviews will not affect the zooming of this webview. Also, per-view zoom changes are reset on navigation; navigating a webview will always load pages with their per-origin zoom factors (within the scope of the partition).
- * "disabled"
+ * 'disabled'
* * Disables all zooming in the webview. The content will revert to the default zoom level, and all attempted zoom changes will be ignored. */
- export type ZoomMode = "per-origin" | "per-view" | "disabled";
-
- /**
- * @description Queries audio state.
- * @param {any} [object Object]
- */
- export function getAudioState(callback: (audible: boolean) => void): void;
-
- /**
- * @description Sets audio mute state of the webview.
- * @param {boolean} mute Mute audio value
- */
- export function setAudioMuted(mute: boolean): void;
-
- /**
- * @description Queries whether audio is muted.
- * @param {any} [object Object]
- */
- export function isAudioMuted(callback: (muted: boolean) => void): void;
-
- /**
- * @description Captures the visible region of the webview.
- * @param {(dataUrl: string) => void} callback A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
- */
- export function captureVisibleRegion(callback: (dataUrl: string) => void): void;
- /**
- * @description Captures the visible region of the webview.
- * @param {*} options
- * @param {(dataUrl: string) => void} callback
- */
- export function captureVisibleRegion(options: chrome.extensionTypes.ImageDetails, callback: (dataUrl: string) => void): void;
-
- /**
- * @description Adds content script injection rules to the webview. When the webview navigates to a page matching one or more rules, the associated scripts will be injected. You can programmatically add rules or update existing rules.
The following example adds two rules to the webview: 'myRule' and 'anotherRule'.
webview.addContentScripts([
- {
- name: 'myRule',
- matches: ['http://www.foo.com/*'],
- css: { files: ['mystyles.css'] },
- js: { files: ['jquery.js', 'myscript.js'] },
- run_at: 'document_start'
- },
- {
- name: 'anotherRule',
- matches: ['http://www.bar.com/*'],
- js: { code: "document.body.style.backgroundColor = 'red';" },
- run_at: 'document_end'
- }]);
- ...
-
- // Navigates webview.
- webview.src = 'http://www.foo.com';You can defer addContentScripts call until you needs to inject scripts.
The following example shows how to overwrite an existing rule.
webview.addContentScripts([{
- name: 'rule',
- matches: ['http://www.foo.com/*'],
- js: { files: ['scriptA.js'] },
- run_at: 'document_start'}]);
-
- // Do something.
- webview.src = 'http://www.foo.com/*';
- ...
- // Overwrite 'rule' defined before.
- webview.addContentScripts([{
- name: 'rule',
- matches: ['http://www.bar.com/*'],
- js: { files: ['scriptB.js'] },
- run_at: 'document_end'}]);If webview has been naviagted to the origin (e.g., foo.com) and calls webview.addContentScripts to add 'myRule', you need to wait for next navigation to make the scripts injected. If you want immediate injection, executeScript will do the right thing.
Rules are preserved even if the guest process crashes or is killed or even if the webview is reparented.
Refer to the content scripts documentation for more details.
- * @param {ContentScriptDetails[]} contentScriptList Details of the content scripts to add.
- */
- export function addContentScripts(contentScriptList: ContentScriptDetails[]): void;
-
- /**
- * @description Navigates backward one history entry if possible. Equivalent to go(-1).
- * @param {(success: boolean) => void} [callback] Called after the navigation has either failed or completed successfully. Success parameter indicates whether the navigation was successful.
- */
- export function back(callback?: (success: boolean) => void): void;
-
- /**
- * @description Indicates whether or not it is possible to navigate backward through history. The state of this function is cached, and updated before each loadcommit, so the best place to call it is on loadcommit.
- */
- export function canGoBack(): void;
-
- /**
- * @description Indicates whether or not it is possible to navigate forward through history. The state of this function is cached, and updated before each loadcommit, so the best place to call it is on loadcommit.
- */
- export function canGoForward(): void;
-
- /**
- * @description Clears browsing data for the webview partition.
- * @param {any} options Options determining which data to clear.
- * @param {any} types The types of data to be cleared.
- * @param {any} [object Object]
- */
- export function clearData(options: ClearDataOptions, types: ClearDataTypeSet, callback?: () => void): void;
-
- /**
- * @description Injects JavaScript code into the guest page.
The following sample code uses script injection to set the guest page's background color to red:
webview.executeScript({ code: "document.body.style.backgroundColor = 'red'" });
- * @param {any} details Details of the script to run.
- * @param {any} [object Object]
- */
- export function executeScript(details: InjectDetails, callback?: (result?: any[]) => void): void;
-
- /**
- * @description Initiates a find-in-page request.
- * @param {string} searchText The string to find in the page.
- * @param {any} options Options for the find request.
- * @param {any} [object Object]
- */
- export function find(searchText: string, options?: FindOptions, callback?: (results?: any) => void): void;
-
- /**
- * @description Navigates forward one history entry if possible. Equivalent to go(1).
- * @param {any} [object Object]
- */
- export function forward(callback?: (success: boolean) => void): void;
-
- /**
- * @description Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID.
- */
- export function getProcessId(): void;
-
- /**
- * @description Returns the user agent string used by the webview for guest page requests.
- */
- export function getUserAgent(): void;
-
- /**
- * @description Gets the current zoom factor.
- * @param {any} [object Object]
- */
- export function getZoom(callback: (zoomFactor: number) => void): void;
-
- /**
- * @description Gets the current zoom mode.
- * @param {any} [object Object]
- */
- export function getZoomMode(callback: (ZoomMode: any) => void): void;
-
- /**
- * @description Navigates to a history entry using a history index relative to the current navigation. If the requested navigation is impossible, this method has no effect.
- * @param {number} relativeIndex Relative history index to which the webview should be navigated. For example, a value of 2 will navigate forward 2 history entries if possible; a value of -3 will navigate backward 3 entries.
- * @param {any} [object Object]
- */
- export function go(relativeIndex: number, callback?: (success: boolean) => void): void;
-
- /**
- * @description Injects CSS into the guest page.
- * @param {any} details Details of the CSS to insert.
- * @param {any} [object Object]
- */
- export function insertCSS(details: InjectDetails, callback?: () => void): void;
-
- /**
- * @description Indicates whether or not the webview's user agent string has been overridden by $(ref:webviewTag.setUserAgentOverride).
- */
- export function isUserAgentOverridden(): void;
-
- /**
- * @description Prints the contents of the webview. This is equivalent to calling scripted print function from the webview itself.
- */
- export function print(): void;
-
- /**
- * @description Reloads the current top-level page.
- */
- export function reload(): void;
-
- /**
- * @description Removes content scripts from a webview.
The following example removes "myRule" which was added before.
webview.removeContentScripts(['myRule']);
You can remove all the rules by calling:
webview.removeContentScripts();
- * @param {any[]} scriptNameList A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the webview will be removed.
- */
- export function removeContentScripts(scriptNameList?: any[]): void;
-
- /**
- * @description Override the user agent string used by the webview for guest page requests.
- * @param {string} userAgent The user agent string to use.
- */
- export function setUserAgentOverride(userAgent: string): void;
-
- /**
- * @description Changes the zoom factor of the page. The scope and persistence of this change are determined by the webview's current zoom mode (see $(ref:webviewTag.ZoomMode)).
- * @param {number} zoomFactor The new zoom factor.
- * @param {any} [object Object]
- */
- export function setZoom(zoomFactor: number, callback?: () => void): void;
-
- /**
- * @description Sets the zoom mode of the webview.
- * @param {any} ZoomMode Defines how zooming is handled in the webview.
- * @param {any} [object Object]
- */
- export function setZoomMode(ZoomMode: ZoomMode, callback?: () => void): void;
-
- /**
- * @description Stops loading the current webview navigation if in progress.
- */
- export function stop(): void;
-
- /**
- * @description Ends the current find session (clearing all highlighting) and cancels all find requests in progress.
- * @param {string} action Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep.
- */
- export function stopFinding(action?: string): void;
-
- /**
- * @description Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL.
- * @param {string} dataUrl The data URL to load.
- * @param {string} baseUrl The base URL that will be used for relative links.
- * @param {string} virtualUrl The URL that will be displayed to the user (in the address bar).
- */
- export function loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void;
-
- /**
- * @description Forcibly kills the guest web page's renderer process. This may affect multiple webview tags in the current app if they share the same process, but it will not affect webview tags in other apps.
- */
- export function terminate(): void;
-
- /**
- * @description Fired when the guest window attempts to close itself.The following example code navigates the webview to about:blank when the guest attempts to close itself.
webview.addEventListener('close', function() {
- webview.src = 'about:blank';
- });
- */
-
- export function close(event: chrome.events.Event): void;
-
- /**
- * @description Fired when the guest window logs a console message.The following example code forwards all log messages to the embedder's console without regard for log level or other properties.
webview.addEventListener('consolemessage', function(e) {
- console.log('Guest page logged a message: ', e.message);
- });
- * @param {any} [object Object]
- */
-
- export var consolemessage: chrome.events.Event;
-
- /**
- * @description Fired when the guest window fires a load event, i.e., when a new document is loaded. This does not include page navigation within the current document or asynchronous resource loads. The following example code modifies the default font size of the guest's body element after the page loads:
webview.addEventListener('contentload', function() {
- webview.executeScript({ code: 'document.body.style.fontSize = "42px"' });
- });
- */
-
- export var contentload: (event: chrome.events.Event) => void;
-
- /**
- * @description Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt.Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.)
The default behavior is to cancel the dialog.
- * @param {any} [object Object]
- */
-
- export var dialog: chrome.events.Event;
-
- /**
- * @description Fired when the process rendering the guest web content has exited.The following example code will show a farewell message whenever the guest page crashes:
webview.addEventListener('exit', function(e) {
- if (e.reason === 'crash') {
- webview.src = 'data:text/plain,Goodbye, world!';
- }
- });
- * @param {any} [object Object]
- */
-
- export var exit: chrome.events.Event;
-
- /**
- * @description Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found.
- * @param {any} [object Object]
- */
-
- export var findupdate: chrome.events.Event;
-
- /**
- * @description Fired when a top-level load has aborted without committing. An error message will be printed to the console unless the event is default-prevented. Note: When a resource load is aborted, a loadabort event will eventually be followed by a loadstop event, even if all committed loads since the last loadstop event (if any) were aborted.
Note: When the load of either an about URL or a JavaScript URL is aborted, loadabort will be fired and then the webview will be navigated to 'about:blank'.
- * @param {any} [object Object]
- */
-
- export var loadabort: chrome.events.Event;
-
- /**
- * @description Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads.
- * @param {any} [object Object]
- */
-
- export var loadcommit: chrome.events.Event;
-
- /**
- * @description Fired when a top-level load request has redirected to a different URL.
- * @param {any} [object Object]
- */
-
- export var loadredirect: chrome.events.Event;
-
- /**
- * @description Fired when a load has begun.
- * @param {any} [object Object]
- */
-
- export var loadstart: chrome.events.Event;
-
- /**
- * @description Fired when all frame-level loads in a guest page (including all its subframes) have completed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. This event fires every time the number of document-level loads transitions from one (or more) to zero. For example, if a page that has already finished loading (i.e., loadstop already fired once) creates a new iframe which loads a page, then a second loadstop will fire when the iframe page load completes. This pattern is commonly observed on pages that load ads. Note: When a committed load is aborted, a loadstop event will eventually follow a loadabort event, even if all committed loads since the last loadstop event (if any) were aborted.
- */
-
- export function loadstop(event: chrome.events.Event): void;
-
- /**
- * @description Fired when the guest page attempts to open a new browser window.The following example code will create and navigate a new webview in the embedder for each requested new window:
webview.addEventListener('newwindow', function(e) {
- var newWebview = document.createElement('webview');
- document.body.appendChild(newWebview);
- e.window.attach(newWebview);
- });
- * @param {any} [object Object]
- */
-
- export var newwindow: chrome.events.Event;
-
- /**
- * @description Fired when the guest page needs to request special permission from the embedder.The following example code will grant the guest page access to the webkitGetUserMedia API. Note that an app using this example code must itself specify audioCapture and/or videoCapture manifest permissions:
webview.addEventListener('permissionrequest', function(e) {
- if (e.permission === 'media') {
- e.request.allow();
- }
- });
- * @param {any} [object Object]
- */
-
- export var permissionrequest: chrome.events.Event;
-
- /**
- * @description Fired when the process rendering the guest web content has become responsive again after being unresponsive.The following example code will fade the webview element in or out as it becomes responsive or unresponsive:
webview.style.webkitTransition = 'opacity 250ms';
- webview.addEventListener('unresponsive', function() {
- webview.style.opacity = '0.5';
- });
- webview.addEventListener('responsive', function() {
- webview.style.opacity = '1';
- });
- * @param {any} [object Object]
- */
-
- export var responsive: chrome.events.Event;
-
- /**
- * @description Fired when the embedded web content has been resized via autosize. Only fires if autosize is enabled.
- * @param {any} [object Object]
- */
-
- export var sizechanged: chrome.events.Event;
-
- /**
- * @description Fired when the process rendering the guest web content has become unresponsive. This event will be generated once with a matching responsive event if the guest begins to respond again.
- * @param {any} [object Object]
- */
-
- export var unresponsive: chrome.events.Event;
-
- /**
- * @description Fired when the page's zoom changes.
- * @param {any} [object Object]
- */
-
- export var zoomchange: chrome.events.Event;
- /**IConsolemessage (Auto generated interface) */
- interface IConsolemessage {
+ export type ZoomMode = 'per-origin' | 'per-view' | 'disabled';
+
+ export enum ConsoleMessageLevel {
+ LOG_VERBOSE = -1,
+ LOG_INFO = 0,
+ LOG_WARNING = 1,
+ LOG_ERROR = 2
+ }
+ interface IConsoleMessage {
/**
* @description The severity level of the log message. Ranges from -1 to 2. LOG_VERBOSE (console.debug) = -1, LOG_INFO (console.log, console.info) = 0, LOG_WARNING (console.warn) = 1, LOG_ERROR (console.error) = 2.
*/
- level: number
+ level: ConsoleMessageLevel;
/**
* @description The logged message contents.
@@ -5539,7 +6539,6 @@ declare namespace chrome {
*/
sourceId: string
}
- /**IDialog (Auto generated interface) */
interface IDialog {
/**
@@ -5557,7 +6556,6 @@ declare namespace chrome {
*/
dialog: DialogController
}
- /**IExit (Auto generated interface) */
interface IExit {
/**
@@ -5570,7 +6568,6 @@ declare namespace chrome {
*/
reason: 'normal' | 'abnormal' | 'crash' | 'kill'
}
- /**IFindupdate (Auto generated interface) */
interface IFindupdate {
/**
@@ -5603,7 +6600,6 @@ declare namespace chrome {
*/
finalUpdate: string
}
- /**ILoadabort (Auto generated interface) */
interface ILoadabort {
/**
@@ -5626,7 +6622,6 @@ declare namespace chrome {
*/
reason: 'ERR_ABORTED' | 'ERR_INVALID_URL' | 'ERR_DISALLOWED_URL_SCHEME' | 'ERR_BLOCKED_BY_CLIENT' | 'ERR_ADDRESS_UNREACHABLE' | 'ERR_EMPTY_RESPONSE' | 'ERR_FILE_NOT_FOUND' | 'ERR_UNKNOWN_URL_SCHEME'
}
- /**ILoadcommit (Auto generated interface) */
interface ILoadcommit {
/**
@@ -5703,7 +6698,6 @@ declare namespace chrome {
*/
windowOpenDisposition: 'ignore' | 'save_to_disk' | 'current_tab' | 'new_background_tab' | 'new_foreground_tab' | 'new_window' | 'new_popup'
}
- /**IPermissionrequest (Auto generated interface) */
interface IPermissionrequest {
/**
@@ -5714,8 +6708,9 @@ declare namespace chrome {
/**
* @description An object which holds details of the requested permission. Depending on the type of permission requested, this may be a $(ref:webviewTag.MediaPermissionRequest), $(ref:webviewTag.GeolocationPermissionRequest), $(ref:webviewTag.PointerLockPermissionRequest), $(ref:webviewTag.DownloadPermissionRequest), $(ref:webviewTag.LoadPluginPermissionRequest), or $(ref:webviewTag.FullscreenPermissionRequest).
*/
- request: object
+ request: GeolocationPermissionRequest | PointerLockPermissionRequest | DownloadPermissionRequest | LoadPluginPermissionRequest | FullscreenPermissionRequest;
}
+
/**IResponsive (Auto generated interface) */
interface IResponsive {
diff --git a/types/chrome-apps/test/index.ts b/types/chrome-apps/test/index.ts
index f976fc57b4..c0dc6402a6 100644
--- a/types/chrome-apps/test/index.ts
+++ b/types/chrome-apps/test/index.ts
@@ -1,7 +1,7 @@
import runtime = chrome.app.runtime;
import cwindow = chrome.app.window;
-var createOptions: cwindow.CreateWindowOptions = {
+const createOptions: cwindow.CreateWindowOptions = {
id: "My Window",
bounds: {
left: 0,
@@ -324,5 +324,40 @@ function testSystemNetwork() {
});
}
-import webview = chrome.webview;
-let element: webview.HTMLWebViewElement;
+const gcmMessage = {};
+gcmMessage.data = {
+ /*goog: 'any', should not be allowed, and it is not :) */
+ test: true
+};
+
+let wve: chrome.webview.HTMLWebViewElement = (document.getElementById('webview'));
+wve.name = 'test';
+wve.src = 'https://github.com/DefinitelyTyped';
+wve.allowtransparency = true;
+wve.autosize = 'on';
+wve.partition = 'persist:githubwebview';
+wve.addEventListener('close', () => {
+ return;
+});
+wve.addEventListener('consolemessage', (ev) => {
+ if (ev.level === chrome.webview.ConsoleMessageLevel.LOG_ERROR) {
+ const msg = ev.message;
+ }
+});
+wve.addEventListener('dialog', (ev) => {
+ ev.dialog.ok('Hello World!');
+});
+wve.addEventListener('loadstart', (ev) => {
+ if (ev.isTopLevel) {
+ return ev.url;
+ }
+ return;
+});
+wve.addEventListener('zoomchange', (ev) => {
+ return ev.newZoomFactor || ev.oldZoomFactor;
+});
+wve.addEventListener('loadredirect', (ev) => {
+ return ev.newUrl || ev.oldUrl;
+});
+
+chrome.bluetoothLowEnergy.connect('1111111', () => { });
diff --git a/types/chromecast-caf-receiver/cast.framework.events.d.ts b/types/chromecast-caf-receiver/cast.framework.events.d.ts
index 0c69727a05..03b70ca459 100644
--- a/types/chromecast-caf-receiver/cast.framework.events.d.ts
+++ b/types/chromecast-caf-receiver/cast.framework.events.d.ts
@@ -367,9 +367,15 @@ declare namespace cast.framework.events {
total?: number,
whenSkippable?: number,
endedReason?: EndedReason,
- breakClipId?: string
+ breakClipId?: string,
+ breakId?: string
);
+ /**
+ * The break's id. Refer to Break.id
+ */
+ breakId?: string;
+
/**
* The break clip's id. Refer to BreakClip.id
*/
diff --git a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts
index a75834b0a8..08ce57cf86 100644
--- a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts
+++ b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts
@@ -8,7 +8,8 @@ import {
} from "chromecast-caf-receiver/cast.framework.system";
import {
RequestEvent,
- Event
+ Event,
+ BreaksEvent
} from "chromecast-caf-receiver/cast.framework.events";
import {
QueueBase,
@@ -29,12 +30,16 @@ import {
MediaMetadata
} from "chromecast-caf-receiver/cast.framework.messages";
+const breaksEvent = new BreaksEvent('BREAK_STARTED');
+breaksEvent.breakId = 'some-break-id';
+breaksEvent.breakClipId = 'some-break-clip-id';
+
const track = new Track(1, "TEXT");
const breakClip = new BreakClip("id");
const adBreak = new Break("id", ["id"], 1);
const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 });
const pManager = new PlayerManager();
-pManager.addEventListener("STALLED", () => {});
+pManager.addEventListener("STALLED", () => { });
const ttManager = new TextTracksManager();
const qManager = new QueueManager();
const qBase = new QueueBase();
@@ -47,10 +52,10 @@ const breakManager: BreakManager = {
getBreakClips: () => [breakClip],
getBreaks: () => [adBreak],
getPlayWatchedBreak: () => true,
- setBreakClipLoadInterceptor: () => {},
- setBreakSeekInterceptor: () => {},
- setPlayWatchedBreak: () => {},
- setVastTrackingInterceptor: () => {}
+ setBreakClipLoadInterceptor: () => { },
+ setBreakSeekInterceptor: () => { },
+ setPlayWatchedBreak: () => { },
+ setVastTrackingInterceptor: () => { }
};
const lrd: LoadRequestData = {
@@ -103,4 +108,4 @@ const pData: PlayerData = {
whenSkippable: 321
};
const binder = new PlayerDataBinder(pData);
-binder.addEventListener("ANY_CHANGE", e => {});
+binder.addEventListener("ANY_CHANGE", e => { });
diff --git a/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts b/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts
new file mode 100644
index 0000000000..c46d48d563
--- /dev/null
+++ b/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts
@@ -0,0 +1,33 @@
+const startupConfiguration: any = { camera_position: 'back' };
+
+// Some code samples from the wikitude ionic starter
+WikitudePlugin.loadARchitectWorld(
+ success => {
+ console.log('ARchitect World loaded successfully.');
+ },
+ fail => {
+ console.log('Failed to load ARchitect World!');
+ },
+ 'www/assets/07_3dModels_6_3dModelAtGeoLocation/index.html',
+ ['geo'],
+ startupConfiguration
+);
+
+WikitudePlugin.setOnUrlInvokeCallback(url => {
+ if (url.indexOf('captureScreen') > -1) {
+ WikitudePlugin.captureScreen(
+ absoluteFilePath => {
+ WikitudePlugin.callJavaScript(
+ `World.testFunction('Screenshot saved at: ${absoluteFilePath}');`
+ );
+ },
+ errorMessage => {
+ console.log(errorMessage);
+ },
+ true,
+ null
+ );
+ } else {
+ alert(url + 'not handled');
+ }
+});
diff --git a/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts b/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts
new file mode 100644
index 0000000000..50307d57c8
--- /dev/null
+++ b/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts
@@ -0,0 +1,82 @@
+// Type definitions for com.wikitude.phonegap.wikitudeplugin 7.2
+// Project: https://github.com/Wikitude/wikitude-cordova-plugin
+// Definitions by: zbarbuto
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
+
+// The following types are taken directly (unmodified) from the wikitude-ionic-3-starter-app
+// https://github.com/pbreuss/wikitude-ionic-3-starter-app
+// Latest commit at time of writing was 647cd546f6d1805765c4cee725566e246ca6259d
+
+/**
+ * Wrapper for the Wikitude SDK Phonegap Plugin - to use with IONIC2
+ * (c) 2016 Schneeweis.Technology
+ */
+interface WikitudePlugin {
+ isDeviceSupported(
+ successCallback: (success: string) => void,
+ errorCallback: (message: string) => void,
+ requiredFeatures: [string]
+ ): void;
+
+ loadARchitectWorld(
+ successCallback: (success: string) => void,
+ errorCallback: (message: string) => void,
+ architectWorldPath: string,
+ requiredFeatures: [string],
+ startupConfiguration: JSON | object
+ ): void;
+
+ close(): void;
+
+ hide(): void;
+
+ show(): void;
+
+ // test type ok?
+ callJavaScript(js: any): void;
+
+ setOnUrlInvokeCallback(onUrlInvokeCallback: (success: string) => void): void;
+
+ setLocation(latitude: any, longitude: any, altitude: any, accuracy: any): void;
+
+ captureScreen(
+ successCallback: (success: string) => void,
+ errorCallback: (message: string) => void,
+ includeWebView: boolean,
+ imagePathInBundleOrNullForPhotoLibrary: string | null
+ ): void;
+
+ setErrorHandler(errorHandler: (message: string) => void): void;
+
+ setDeviceSensorsNeedCalibrationHandler(
+ startCalibrationHandler: (message: string) => void
+ ): void;
+
+ setDeviceSensorsFinishedCalibrationHandler(
+ finishedCalibrationHandler: (message: string) => void
+ ): void;
+
+ setBackButtonCallback(onBackButtonCallback: (message: string) => void): void;
+
+ /* Lifecycle updates */
+
+ onResume(): void;
+ onBackButton(): void;
+ onPause(): void;
+
+ onWikitudeOK(): void;
+ onWikitudeError(): void;
+
+ _sdkKey: string;
+ FeatureGeo: string;
+ Feature2DTracking: string;
+ CameraPositionUndefined: number;
+ CameraPositionFront: number;
+ CameraPositionBack: number;
+ CameraFocusRangeNone: number;
+ CameraFocusRangeNear: number;
+ CameraFocusRangeFar: number;
+}
+
+declare var WikitudePlugin: WikitudePlugin;
diff --git a/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json b/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json
new file mode 100644
index 0000000000..ed0ce7783e
--- /dev/null
+++ b/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json
@@ -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",
+ "com.wikitude.phonegap.wikitudeplugin-tests.ts"
+ ]
+}
diff --git a/types/com.wikitude.phonegap.wikitudeplugin/tslint.json b/types/com.wikitude.phonegap.wikitudeplugin/tslint.json
new file mode 100644
index 0000000000..f93cf8562a
--- /dev/null
+++ b/types/com.wikitude.phonegap.wikitudeplugin/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": "dtslint/dt.json"
+}
diff --git a/types/config-yaml/config-yaml-tests.ts b/types/config-yaml/config-yaml-tests.ts
new file mode 100644
index 0000000000..4ddf61e69f
--- /dev/null
+++ b/types/config-yaml/config-yaml-tests.ts
@@ -0,0 +1,5 @@
+import yaml = require('config-yaml');
+
+yaml('./simple.yaml');
+yaml('./simple.yaml', { encoding: 'gbk' });
+yaml('./simple.yaml', { encoding: 'utf-8' });
diff --git a/types/config-yaml/index.d.ts b/types/config-yaml/index.d.ts
new file mode 100644
index 0000000000..6f2be7957b
--- /dev/null
+++ b/types/config-yaml/index.d.ts
@@ -0,0 +1,19 @@
+// Type definitions for config-yaml 1.1
+// Project: https://github.com/neolao/config-yaml#readme
+// Definitions by: My Self
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+// TypeScript Version: 2.1
+
+///
+import * as fs from 'fs';
+
+export = Yaml;
+
+declare namespace Yaml {
+ interface Options {
+ encoding: string;
+ }
+}
+
+declare function Yaml(path: fs.PathLike, options?: Partial): any;
diff --git a/types/config-yaml/tsconfig.json b/types/config-yaml/tsconfig.json
new file mode 100644
index 0000000000..fa349a2f41
--- /dev/null
+++ b/types/config-yaml/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es6"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "allowSyntheticDefaultImports": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "config-yaml-tests.ts"
+ ]
+}
diff --git a/types/config-yaml/tslint.json b/types/config-yaml/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/config-yaml/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json
index ca12068b57..c0c9ab3043 100644
--- a/types/connect-mongo/tsconfig.json
+++ b/types/connect-mongo/tsconfig.json
@@ -7,7 +7,10 @@
"paths": {
"mongodb": [
"mongodb/v2"
- ]
+ ],
+ "mongoose": [
+ "mongoose/v4"
+ ]
},
"noImplicitAny": true,
"noImplicitThis": true,
@@ -25,4 +28,4 @@
"index.d.ts",
"connect-mongo-tests.ts"
]
-}
\ No newline at end of file
+}
diff --git a/types/cosmiconfig/cosmiconfig-tests.ts b/types/cosmiconfig/cosmiconfig-tests.ts
index c477eedb3e..f25337f3d3 100644
--- a/types/cosmiconfig/cosmiconfig-tests.ts
+++ b/types/cosmiconfig/cosmiconfig-tests.ts
@@ -1,4 +1,5 @@
-import cosmiconfig, { CosmiconfigResult } from "cosmiconfig";
+import cosmiconfig = require("cosmiconfig");
+import { CosmiconfigResult } from "cosmiconfig";
import * as path from "path";
const explorer = cosmiconfig("yourModuleName", {
diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts
index 16ba1967f3..94e28e9dab 100644
--- a/types/cosmiconfig/index.d.ts
+++ b/types/cosmiconfig/index.d.ts
@@ -3,57 +3,62 @@
// Definitions by: ozum
// szeck87
// saadq
+// jinwoo
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
///
-export interface Config {
- [key: string]: any;
+declare function cosmiconfig(moduleName: string, options?: cosmiconfig.ExplorerOptions): cosmiconfig.Explorer;
+
+declare namespace cosmiconfig {
+ interface Config {
+ [key: string]: any;
+ }
+
+ type CosmiconfigResult = {
+ config: Config;
+ filepath: string;
+ isEmpty?: boolean;
+ } | null;
+
+ interface LoaderResult {
+ config: Config | null;
+ filepath: string;
+ }
+
+ type SyncLoader = (filepath: string, content: string) => Config | null;
+ type AsyncLoader = (filepath: string, content: string) => Config | null | Promise