Merge remote-tracking branch 'upstream/master' into AlexJ-OutlookMigration

This commit is contained in:
Alex Jerabek
2018-06-08 10:09:01 -07:00
47 changed files with 11007 additions and 1803 deletions
+5781
View File
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,3 @@
import runtime = chrome.app.runtime;
import cwindow = chrome.app.window;
@@ -44,7 +42,7 @@ var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces(
function test_fileSystem(): void {
var accepts: chrome.fileSystem.AcceptOptions[] = [
{mimeTypes: ["text/*"], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf']}
{ mimeTypes: ["text/*"], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf'] }
];
var chooseOption: chrome.fileSystem.ChooseEntryOptions = {
type: "openFile",
@@ -58,13 +56,13 @@ function test_fileSystem(): void {
var retainedId = chrome.fileSystem.retainEntry(entry);
chrome.fileSystem.isRestorable(retainedId, (isRestorable: boolean) => {
if(isRestorable){
if (isRestorable) {
chrome.fileSystem.restoreEntry(retainedId, (restoredEntry: Entry) => { });
}
});
chrome.fileSystem.getWritableEntry(entry, (writableEntry: Entry) => {});
chrome.fileSystem.isWritableEntry(entry, (isWritable: boolean) => {});
chrome.fileSystem.getWritableEntry(entry, (writableEntry: Entry) => { });
chrome.fileSystem.isWritableEntry(entry, (isWritable: boolean) => { });
});
}
@@ -325,3 +323,6 @@ function testSystemNetwork() {
}
});
}
import webview = chrome.webview;
let element: webview.HTMLWebViewElement;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es2017",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"test/index.ts"
]
}
+79
View File
@@ -0,0 +1,79 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
}
-1503
View File
File diff suppressed because it is too large Load Diff
-109
View File
@@ -1,109 +0,0 @@
/// <reference path="chrome-app.d.ts" />
// Project: http://developer.chrome.com/apps/
// Definitions by: Nikolai Ommundsen <https://github.com/niikoo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
//
// WebView ref: https://chromium.googlesource.com/chromium/src/+/64.0.3274.2/chrome/common/extensions/api/webview_tag.json
//
///////////////////
// <webview> Tag
///////////////////
/**
* Use the <code>webview</code> 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 <code>webview</code> and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see <a href=\"#usage\">Usage</a>).
*/
declare namespace chrome.webviewTag {
/** Options that determine what data should be cleared by `clearData`. */
export interface ClearDataOptions {
/** Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript <code>Date</code> object). If absent, defaults to <code>0</code> (which would remove all browsing data). */
since: number;
}
export interface WindowEvent extends chrome.events.Event<() => void> {}
export interface ConsoleEvent extends Event {
/**
* @description The severity level of the log message. Ranges from 0 to 4.
* @type {number}
* @memberof ConsoleEvent
*/
level: number,
/**
* @description The logged message contents.
* @type {string}
* @memberof ConsoleEvent
*/
message: string,
/**
* @description The line number of the message source.
* @type {number}
* @memberof ConsoleEvent
*/
line: number,
/**
* @description A string identifying the resource which logged the message.
* @type {string}
* @memberof ConsoleEvent
*/
sourceId: string
}
/** Description of a declarative rule for handling events. */
export interface Rule {
/** Optional priority of this rule. Defaults to 100. */
priority?: number;
/** List of conditions that can trigger the actions. */
conditions: any[];
/** Optional. Optional identifier that allows referencing this rule. */
id?: string;
/** List of actions that are triggered if one of the condtions is fulfilled. */
actions: any[];
/**
* @description Tags can be used to annotate rules and perform operations on sets of rules.¨
* @since Chrome 28
* @type {string[]}
* @memberof Rule
*/
tags?: string[];
}
/**
* @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
* @export
* @interface InjectDetails
*/
export interface InjectDetails {
/**
* @description JavaScript or CSS code to inject.<br><br><b>Warning:</b><br>Be careful using the <code>code</code> parameter. Incorrect use of it may open your app to <a href=\"https://en.wikipedia.org/wiki/Cross-site_scripting\">cross site scripting</a> attacks.
* @type {string}
* @memberof InjectDetails
*/
code?: string,
/**
* @description JavaScript or CSS file to inject.
* @type {string}
* @memberof InjectDetails
*/
file?: string
}
export interface WebViewElementEventMap extends ElementEventMap {
'message': ConsoleEvent
}
/**
* @description
* @export
* @interface HTMLWebViewElement
* @extends {Element}
*/
export interface HTMLWebViewElement extends Element {
executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void,
src: string,
contentWindow: Window
addEventListener<K extends keyof WebViewElementEventMap>(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
}
+140 -138
View File
@@ -135,7 +135,7 @@ declare namespace chrome.alarms {
name: string;
}
export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {}
export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> { }
/**
* Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
@@ -195,7 +195,9 @@ declare namespace chrome.alarms {
export var onAlarm: AlarmEvent;
}
////////////////////
// Browser
////////////////////
/**
* Use the chrome.browser API to interact with the Chrome browser associated with
* the current application and Chrome profile.
@@ -282,19 +284,19 @@ declare namespace chrome.bookmarks {
childIds: string[];
}
export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {}
export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> { }
export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {}
export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> { }
export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {}
export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> { }
export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {}
export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> { }
export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {}
export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> { }
export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {}
export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> { }
export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {}
export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> { }
export interface BookmarkSearchQuery {
query?: string;
@@ -480,7 +482,7 @@ declare namespace chrome.browserAction {
popup: string;
}
export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
/**
* Since Chrome 22.
@@ -737,7 +739,7 @@ declare namespace chrome.commands {
shortcut?: string;
}
export interface CommandEvent extends chrome.events.Event<(command: string) => void> {}
export interface CommandEvent extends chrome.events.Event<(command: string) => void> { }
/**
* Returns all the registered extension commands for this extension and their shortcut (if active).
@@ -1062,7 +1064,7 @@ declare namespace chrome.contextMenus {
type?: string;
}
export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {}
export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> { }
/**
* Since Chrome 38.
@@ -1223,7 +1225,7 @@ declare namespace chrome.cookies {
cause: string;
}
export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {}
export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> { }
/**
* Lists all existing cookie stores.
@@ -1327,9 +1329,9 @@ declare module chrome {
faviconUrl?: string;
}
export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {}
export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> { }
export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {}
export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> { }
/**
* Attaches debugger to the given target.
@@ -1374,7 +1376,7 @@ declare module chrome {
export var onEvent: DebuggerEventEvent;
}
export {_debugger as debugger}
export { _debugger as debugger }
}
////////////////////
// Declarative Content
@@ -1443,14 +1445,14 @@ declare namespace chrome.declarativeContent {
/** Matches the state of a web page by various criteria. */
export class PageStateMatcher {
constructor(options: PageStateMatcherProperties);
constructor (options: PageStateMatcherProperties);
}
/** Declarative event action that shows the extension's page action while the corresponding conditions are met. */
export class ShowPageAction {}
export class ShowPageAction { }
/** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */
export interface PageChangedEvent extends chrome.events.Event<() => void> {}
export interface PageChangedEvent extends chrome.events.Event<() => void> { }
export var onPageChanged: PageChangedEvent;
}
@@ -1559,7 +1561,7 @@ declare namespace chrome.declarativeWebRequest {
filter: RequestCookie;
}
export interface RequestedEvent extends chrome.events.Event<Function> {}
export interface RequestedEvent extends chrome.events.Event<Function> { }
export var onRequest: RequestedEvent;
}
@@ -1660,9 +1662,9 @@ declare namespace chrome.devtools.inspectedWindow {
value: string;
}
export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {}
export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> { }
export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {}
export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> { }
/** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */
export var tabId: number;
@@ -1734,9 +1736,9 @@ declare namespace chrome.devtools.network {
getContent(callback: (content: string, encoding: string) => void): void;
}
export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {}
export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> { }
export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {}
export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> { }
/**
* Returns HAR log that contains all known network requests.
@@ -1761,11 +1763,11 @@ declare namespace chrome.devtools.network {
* Availability: Since Chrome 18.
*/
declare namespace chrome.devtools.panels {
export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> {}
export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> { }
export interface PanelHiddenEvent extends chrome.events.Event<() => void> {}
export interface PanelHiddenEvent extends chrome.events.Event<() => void> { }
export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {}
export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> { }
/** Represents a panel created by extension. */
export interface ExtensionPanel {
@@ -1784,7 +1786,7 @@ declare namespace chrome.devtools.panels {
onSearch: PanelSearchEvent;
}
export interface ButtonClickedEvent extends chrome.events.Event<() => void> {}
export interface ButtonClickedEvent extends chrome.events.Event<() => void> { }
/** A button created by the extension. */
export interface Button {
@@ -1799,7 +1801,7 @@ declare namespace chrome.devtools.panels {
onClicked: ButtonClickedEvent;
}
export interface SelectionChangedEvent extends chrome.events.Event<() => void> {}
export interface SelectionChangedEvent extends chrome.events.Event<() => void> { }
/** Represents the Elements panel. */
export interface ElementsPanel {
@@ -1834,9 +1836,9 @@ declare namespace chrome.devtools.panels {
onSelectionChanged: SelectionChangedEvent;
}
export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {}
export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> { }
export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {}
export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> { }
/** A sidebar created by the extension. */
export interface ExtensionSidebarPane {
@@ -2152,13 +2154,13 @@ declare namespace chrome.downloads {
conflictAction?: string;
}
export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {}
export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> { }
export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {}
export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> { }
export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {}
export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> { }
export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {}
export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> { }
/**
* Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
@@ -2507,7 +2509,7 @@ declare namespace chrome.extension {
message: string;
}
export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {}
export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> { }
/**
* Since Chrome 7.
@@ -2618,7 +2620,7 @@ declare namespace chrome.fileBrowserHandler {
entries: any[];
}
export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {}
export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> { }
/**
* Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture.
@@ -2864,33 +2866,33 @@ declare namespace chrome.fileSystemProvider {
operationRequestId: number;
}
export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {}
export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> { }
export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {}
export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { }
export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {}
export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { }
export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> { }
/**
* Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string.
@@ -3051,13 +3053,13 @@ declare namespace chrome.fontSettings {
fontId: string;
}
export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { }
export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { }
export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { }
export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {}
export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> { }
/**
* Sets the default font size.
@@ -3199,11 +3201,11 @@ declare namespace chrome.gcm {
detail: Object;
}
export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {}
export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> { }
export interface MessageDeletionEvent extends chrome.events.Event<() => void> {}
export interface MessageDeletionEvent extends chrome.events.Event<() => void> { }
export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {}
export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> { }
/** The maximum size (in bytes) of all key/value pairs in a message. */
export var MAX_MESSAGE_SIZE: number;
@@ -3311,9 +3313,9 @@ declare namespace chrome.history {
urls?: string[];
}
export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}
export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> { }
export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}
export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> { }
/**
* Searches the history for the last visit time of each page matching the query.
@@ -3473,7 +3475,7 @@ declare namespace chrome.identity {
interactive?: boolean;
}
export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {}
export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { }
/**
* Retrieves a list of AccountInfo objects describing the accounts present on the profile.
@@ -3540,7 +3542,7 @@ declare namespace chrome.identity {
* @since Chrome 6.
*/
declare namespace chrome.idle {
export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {}
export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> { }
/**
* Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
@@ -3829,25 +3831,25 @@ declare namespace chrome.input.ime {
anchor: number;
}
export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {}
export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> { }
export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {}
export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> { }
export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {}
export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> { }
export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {}
export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> { }
export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {}
export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> { }
export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {}
export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> { }
export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {}
export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> { }
export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {}
export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> { }
export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {}
export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> { }
export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {}
export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> { }
/**
* Adds the provided menu items to the language menu when this IME is active.
@@ -4079,13 +4081,13 @@ declare namespace chrome.management {
showConfirmDialog?: boolean;
}
export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { }
export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {}
export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> { }
export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { }
export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { }
/**
* Enables or disables an app or extension.
@@ -4232,7 +4234,7 @@ declare namespace chrome.networking.config {
Security?: string;
}
export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {}
export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> { }
/**
* Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list.
@@ -4337,15 +4339,15 @@ declare namespace chrome.notifications {
requireInteraction?: boolean;
}
export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {}
export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> { }
export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {}
export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> { }
export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {}
export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> { }
export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {}
export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> { }
export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {}
export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> { }
/** The notification closed, either by the system or by user action. */
export var onClosed: NotificationClosedEvent;
@@ -4445,13 +4447,13 @@ declare namespace chrome.omnibox {
description: string;
}
export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {}
export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> { }
export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {}
export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> { }
export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {}
export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> { }
export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {}
export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> { }
/**
* Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
@@ -4478,7 +4480,7 @@ declare namespace chrome.omnibox {
* @since Chrome 5.
*/
declare namespace chrome.pageAction {
export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
export interface TitleDetails {
/** The id of the tab for which you want to modify the page action. */
@@ -4787,13 +4789,13 @@ declare namespace chrome.printerProvider {
document: Blob;
}
export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {}
export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> { }
export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {}
export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> { }
export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {}
export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> { }
export interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {}
export interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> { }
/** Event fired when print manager requests printers provided by extensions. */
export var onGetPrintersRequested: PrinterRequestedEvent;
@@ -4930,7 +4932,7 @@ declare namespace chrome.proxy {
fatal: boolean;
}
export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {}
export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> { }
export var settings: chrome.types.ChromeSetting;
/** Notifies about proxy errors. */
@@ -5060,21 +5062,21 @@ declare namespace chrome.runtime {
version: string;
}
export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {}
export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> { }
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> {}
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { }
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {}
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { }
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {}
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { }
export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {}
export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> { }
export interface RuntimeEvent extends chrome.events.Event<() => void> {}
export interface RuntimeEvent extends chrome.events.Event<() => void> { }
export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {}
export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> { }
export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {}
export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> { }
export interface ManifestIcons {
[size: number]: string;
@@ -5462,7 +5464,7 @@ declare namespace chrome.scriptBadge {
popup: string;
}
export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
export function getPopup(details: GetPopupDetails, callback: Function): void;
export function getAttention(details: AttentionDetails): void;
@@ -5510,7 +5512,7 @@ declare namespace chrome.sessions {
sessions: Session[];
}
export interface SessionChangedEvent extends chrome.events.Event<() => void> {}
export interface SessionChangedEvent extends chrome.events.Event<() => void> { }
/** The maximum number of sessions.Session that will be included in a requested list. */
export var MAX_SESSION_RESULTS: number;
@@ -5646,7 +5648,7 @@ declare namespace chrome.storage {
MAX_WRITE_OPERATIONS_PER_MINUTE: number;
}
export interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> {}
export interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> { }
/** Items in the local storage area are local to each machine. */
export var local: LocalStorageArea;
@@ -5820,9 +5822,9 @@ declare namespace chrome.system.storage {
availableCapacity: number;
}
export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {}
export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> { }
export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {}
export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> { }
/** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */
export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
@@ -5876,7 +5878,7 @@ declare namespace chrome.tabCapture {
videoConstraints?: MediaStreamConstraints;
}
export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {}
export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> { }
/**
* Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension.
@@ -6364,27 +6366,27 @@ declare namespace chrome.tabs {
zoomSettings: ZoomSettings;
}
export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {}
export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> { }
export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {}
export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> { }
export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {}
export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> { }
export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {}
export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> { }
export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {}
export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> { }
export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {}
export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> { }
export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {}
export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> { }
export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {}
export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> { }
export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {}
export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> { }
export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {}
export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> { }
export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {}
export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> { }
/**
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
@@ -6872,7 +6874,7 @@ declare namespace chrome.ttsEngine {
pitch?: number;
}
export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {}
export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> { }
/** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */
export var onSpeak: TtsEngineSpeakEvent;
@@ -6956,7 +6958,7 @@ declare namespace chrome.types {
incognitoSpecific?: boolean;
}
export interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> {}
export interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> { }
/** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */
export interface ChromeSetting {
@@ -7013,15 +7015,15 @@ declare namespace chrome.vpnProvider {
dnsServer: string[];
}
export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {}
export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> { }
export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {}
export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> { }
export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {}
export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> { }
export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {}
export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> { }
export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {}
export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> { }
/**
* Creates a new VPN configuration that persists across multiple login sessions of the user.
@@ -7219,17 +7221,17 @@ declare namespace chrome.webNavigation {
addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void;
}
export interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> {}
export interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> { }
export interface WebNavigationFramedErrorEvent extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails> {}
export interface WebNavigationFramedErrorEvent extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails> { }
export interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> {}
export interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> { }
export interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> {}
export interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> { }
export interface WebNavigationTransitionalEvent extends WebNavigationEvent<WebNavigationTransitionCallbackDetails> {}
export interface WebNavigationTransitionalEvent extends WebNavigationEvent<WebNavigationTransitionCallbackDetails> { }
export interface WebNavigationReplacementEvent extends WebNavigationEvent<WebNavigationReplacementCallbackDetails> {}
export interface WebNavigationReplacementEvent extends WebNavigationEvent<WebNavigationReplacementCallbackDetails> { }
/**
* Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
@@ -7463,17 +7465,17 @@ declare namespace chrome.webRequest {
addListener(callback: (details: T) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
}
export interface WebResponseHeadersEvent extends _WebResponseHeadersEvent<WebResponseHeadersDetails> {}
export interface WebResponseHeadersEvent extends _WebResponseHeadersEvent<WebResponseHeadersDetails> { }
export interface WebResponseCacheEvent extends _WebResponseHeadersEvent<WebResponseCacheDetails> {}
export interface WebResponseCacheEvent extends _WebResponseHeadersEvent<WebResponseCacheDetails> { }
export interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> {}
export interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> { }
export interface WebAuthenticationChallengeEvent extends chrome.events.Event<(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void> {
addListener(callback: (details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
}
export interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> {}
export interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> { }
/**
* The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often.
@@ -7588,9 +7590,9 @@ declare namespace chrome.webstore {
*/
export function install(failureCallback?: (error: string, errorCode?: string) => void): void;
export interface InstallationStageEvent extends chrome.events.Event<(stage: string) => void> {}
export interface InstallationStageEvent extends chrome.events.Event<(stage: string) => void> { }
export interface DownloadProgressEvent extends chrome.events.Event<(percentDownloaded: number) => void> {}
export interface DownloadProgressEvent extends chrome.events.Event<(percentDownloaded: number) => void> { }
/**
* Fired when an inline installation enters a new InstallStage. In order to receive notifications about this event, listeners must be registered before the inline installation begins.
@@ -7753,9 +7755,9 @@ declare namespace chrome.windows {
windowTypes: string[];
}
export interface WindowIdEvent extends chrome.events.Event<(windowId: number, filters?: WindowEventFilter) => void> {}
export interface WindowIdEvent extends chrome.events.Event<(windowId: number, filters?: WindowEventFilter) => void> { }
export interface WindowReferenceEvent extends chrome.events.Event<(window: Window, filters?: WindowEventFilter) => void> {}
export interface WindowReferenceEvent extends chrome.events.Event<(window: Window, filters?: WindowEventFilter) => void> { }
/**
* The windowId value that represents the current window.
-4
View File
@@ -1,4 +0,0 @@
import webview = chrome.webviewTag;
let element: webview.HTMLWebViewElement;
+1 -5
View File
@@ -19,11 +19,7 @@
},
"files": [
"index.d.ts",
"chrome-app.d.ts",
"chrome-webview.d.ts",
"chrome-cast/index.d.ts",
"test/index.ts",
"test/chrome-app.ts",
"test/chrome-webview.ts"
"test/index.ts"
]
}
+4 -4
View File
@@ -105,11 +105,11 @@ declare namespace connectMongo {
export class MongoStore extends session.Store {
get: (sid: string, callback: (err: any, session: Express.Session) => void) => void;
set: (sid: string, session: Express.Session, callback: (err: any) => void) => void;
destroy: (sid: string, callback: (err: any) => void) => void;
set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
destroy: (sid: string, callback?: (err: any) => void) => void;
length: (callback: (err: any, length: number) => void) => void;
clear: (callback: (err: any) => void) => void;
touch: (sid: string, session: Express.Session, callback: (err: any) => void) => void;
clear: (callback?: (err: any) => void) => void;
touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
}
}
+36 -1
View File
@@ -37,7 +37,9 @@ import {
Calendar,
MailComposer,
Location,
Updates
Updates,
MediaLibrary,
Haptic
} from 'expo';
const reverseGeocode: Promise<Location.GeocodeData[]> = Location.reverseGeocodeAsync({
@@ -778,3 +780,36 @@ async () => {
console.log(bundleFetchResult.manifest);
}
};
// #region MediaLibrary
async () => {
const mlAsset: MediaLibrary.Asset = await MediaLibrary.createAssetAsync('localUri');
const mlAssetResult: MediaLibrary.GetAssetsResult = await MediaLibrary.getAssetsAsync({
first: 0,
after: '',
album: 'Album',
sortBy: MediaLibrary.SortBy.creationTime,
mediaType: MediaLibrary.MediaType.photo
});
const mlAsset1: MediaLibrary.Asset = await MediaLibrary.getAssetInfoAsync(mlAsset);
const areDeleted: boolean = await MediaLibrary.deleteAssetsAsync([mlAsset]);
const albums: MediaLibrary.Album[] = await MediaLibrary.getAlbumsAsync();
const album: MediaLibrary.Album = await MediaLibrary.getAlbumAsync('album');
const album1: MediaLibrary.Album = await MediaLibrary.createAlbumAsync('album', mlAsset);
const areAddedToAlbum: boolean = await MediaLibrary.addAssetsToAlbumAsync([mlAsset, mlAsset1], 'album');
const areDeletedFromAlbum: boolean = await MediaLibrary.removeAssetsFromAlbumAsync([mlAsset, mlAsset1], 'album');
const momuents: MediaLibrary.Album[] = await MediaLibrary.getMomentsAsync();
};
//#endregion
// #region Haptic
Haptic.impact(Haptic.ImpactStyles.Heavy);
Haptic.impact(Haptic.ImpactStyles.Light);
Haptic.impact(Haptic.ImpactStyles.Medium);
Haptic.notification(Haptic.NotificationType.Error);
Haptic.notification(Haptic.NotificationType.Success);
Haptic.notification(Haptic.NotificationType.Error);
Haptic.selection();
// #endregion
+195 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for expo 26.0
// Type definitions for expo 27.0
// Project: https://github.com/expo/expo-sdk
// Definitions by: Konstantin Kai <https://github.com/KonstantinKai>
// Martynas Kadiša <https://github.com/martynaskadisa>
@@ -6,6 +6,7 @@
// Sergio Sánchez <https://github.com/ssanchezmarc>
// Fernando Helwanger <https://github.com/fhelwanger>
// Umidbek Karimov <https://github.com/umidbekkarimov>
// Moshe Feuchtwanger <https://github.com/moshfeu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
@@ -1520,6 +1521,9 @@ export namespace ImagePicker {
mediaTypes?: keyof _MediaTypeOptions;
}
/**
* require Permissions.CAMERA_ROLL
*/
function launchImageLibraryAsync(options?: ImageLibraryOptions): Promise<ImageResult>;
interface CameraOptions {
@@ -1528,6 +1532,9 @@ export namespace ImagePicker {
quality?: number;
}
/**
* require Permissions.CAMERA_ROLL
*/
function launchCameraAsync(options?: CameraOptions): Promise<ImageResult>;
}
@@ -2729,7 +2736,7 @@ export namespace Calendar {
}
// #endregion
// #region Calendar
// #region MailComposer
/**
* An API to compose mails using OS specific UI.
*/
@@ -2852,3 +2859,189 @@ export namespace Updates {
*/
function reloadFromCache(): void;
}
// #region MediaLibrary
/**
* https://docs.expo.io/versions/latest/sdk/media-library
* Provides access to user's media library
* Requires Permissions.CAMERA_ROLL permissions.
*/
export namespace MediaLibrary {
/**
* Creates an asset from existing file. The most common use case is to save a picture taken by Camera.
*/
function createAssetAsync(localUri: string): Promise<Asset>;
/**
* Fetches a page of assets matching the provided criteria.
*/
function getAssetsAsync(options: GetAssetsOptions): Promise<GetAssetsResult>;
/**
* Provides more informations about an asset, including GPS location, local URI and EXIF metadata.
*/
function getAssetInfoAsync(asset: string | Asset): Promise<Asset>;
/**
* Deletes assets from the library. On iOS it deletes assets from all albums they belong to, while on Android it keeps all copies of them
* (album is strictly connected to the asset). Also, there is additional dialog on iOS that requires user to confirm this action.
*/
function deleteAssetsAsync(asset: string[] | Asset[]): Promise<boolean>;
/**
* Queries for user-created albums in media gallery.
*/
function getAlbumsAsync(): Promise<Album[]>;
/**
* Queries for an album with a specific name.
*/
function getAlbumAsync(albumName: string): Promise<Album>;
/**
* Creates an album with given name and initial asset.
* The asset parameter is required on Android, since it's not possible to create empty album on this platform.
*/
function createAlbumAsync(albumName: string, asset: string | Asset): Promise<Album>;
/**
* Adds array of assets to the album.
* On Android, by default it copies assets from the current album to provided one, however it's also possible to move them by passing false as copyAssets argument.
* In case they're copied you should keep in mind that getAssetsAsync will return duplicated assets.
*/
function addAssetsToAlbumAsync(assets: Asset[], album: string | Album, copyAssets?: boolean /* default true */): Promise<boolean>;
/**
* Removes given assets from album.
* On Android, album will be automatically deleted if there are no more assets inside.
*/
function removeAssetsFromAlbumAsync(assets: Asset[], album: string | Album): Promise<boolean>;
/**
* Available on iOS only. Fetches a list of moments, which is a group of assets taken around the same place and time.
*/
function getMomentsAsync(): Promise<Album[]>;
enum MediaType {
audio = 'audio',
photo = 'photo',
video = 'video',
unknow = 'unknow'
}
enum SortBy {
default = 'default',
id = 'id',
creationTime = 'creationTime',
modificationTime = 'modificationTime',
mediaType = 'mediaType',
width = 'width',
height = 'height',
duration = 'duration'
}
// region Asset
interface AssetAndroid {
albumId?: string;
}
interface AssetIos {
mediaSubtypes?: MediaType[];
// *
orientation: number;
// *
isFavorite: boolean;
}
interface Asset extends AssetAndroid, AssetIos {
id: string;
filename: string;
uri: string;
mediaType: string;
width: number;
height: number;
creationTime: number;
modificationTime: number;
duration: number;
// *
localUri?: string;
// *
location?: Location.LocationProps;
// *
exif?: object;
}
/**
* These fields can be obtained only by calling getAssetInfoAsync method
*/
//#endregion
// #region Album
interface AlbumIos {
type?: string;
// *
startTime: number;
// *
endTime: number;
// *
approximateLocation?: Location.LocationProps;
// *
locationNames?: string[];
}
/**
* These fields apply only to albums whose type is moment
*/
interface Album extends AlbumIos {
id: string;
title: string;
assetCount: number;
}
// #endregion
interface GetAssetsOptions {
first?: number;
after?: string;
album?: string | Album;
sortBy?: SortBy;
mediaType?: MediaType;
}
interface GetAssetsResult {
assets: Asset[];
endCursor: string;
hasNextPage: boolean;
totalCount: number;
}
}
// #endregion
// #region Haptic
/**
* https://docs.expo.io/versions/latest/sdk/haptic
* Provides haptic feedback for iOS 10+ devices using the Taptic Engine.
* If this is used in Android the device will use ReactNative.Vibrate instead, it's best to just avoid this.
*/
export namespace Haptic {
/**
* Used to let a user know when a selection change has been registered
*/
function selection(): void;
function notification(notificationType?: NotificationType): void;
function impact(impactStyles?: ImpactStyles): void;
enum ImpactStyles {
Light = 'light',
Medium = 'medium',
Heavy = 'heavy'
}
enum NotificationType {
Success = 'success',
Warning = 'warning',
Error = 'error'
}
}
// #endregion
+780
View File
@@ -0,0 +1,780 @@
import * as React from 'react';
import { Text } from 'react-native';
import {
Accelerometer,
AdMobAppEvent,
AdMobBanner,
AdMobInterstitial,
AdMobRewarded,
Amplitude,
Asset,
AuthSession,
Audio,
AppLoading,
BarCodeScanner,
BlurViewProps,
BlurView,
Brightness,
Camera,
CameraObject,
DocumentPicker,
Facebook,
FacebookAds,
FileSystem,
ImagePicker,
ImageManipulator,
FaceDetector,
Svg,
IntentLauncherAndroid,
KeepAwake,
LinearGradient,
Permissions,
PublisherBanner,
registerRootComponent,
ScreenOrientation,
SQLite,
Calendar,
MailComposer,
Location,
Updates
} from 'expo';
const reverseGeocode: Promise<Location.GeocodeData[]> = Location.reverseGeocodeAsync({
latitude: 0,
longitude: 0
});
Accelerometer.addListener((obj) => {
obj.x;
obj.y;
obj.z;
});
Accelerometer.removeAllListeners();
Accelerometer.setUpdateInterval(1000);
() => (
<AdMobBanner
bannerSize="leaderboard"
adUnitID="ca-app-pub-3940256099942544/6300978111"
testDeviceID="EMULATOR"
didFailToReceiveAdWithError={(error: string) => console.log(error)}
style={{ flex: 1 }}
/>
);
() => (
<PublisherBanner
bannerSize="leaderboard"
adUnitID="ca-app-pub-3940256099942544/6300978111"
testDeviceID="EMULATOR"
didFailToReceiveAdWithError={(error: string) => console.log(error)}
onAdMobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)}
style={{ flex: 1 }}
/>
);
AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobInterstitial.setTestDeviceID('EMULATOR');
async () => {
await AdMobInterstitial.requestAdAsync();
await AdMobInterstitial.showAdAsync();
};
AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobRewarded.setTestDeviceID('EMULATOR');
async () => {
await AdMobRewarded.requestAdAsync();
await AdMobRewarded.showAdAsync();
};
Amplitude.initialize('key');
Amplitude.setUserId('userId');
Amplitude.setUserProperties({key: 1});
Amplitude.clearUserProperties();
Amplitude.logEvent('name');
Amplitude.logEventWithProperties('event', {key: 'value'});
Amplitude.setGroup('type', ['value']);
const asset = Asset.fromModule(1);
asset.downloadAsync();
Asset.loadAsync(1);
Asset.loadAsync([1, 2, 3]);
const asset1 = new Asset({
uri: 'uri',
type: 'type',
name: 'name',
hash: 'hash',
width: 122,
height: 122
});
const url = AuthSession.getRedirectUrl();
AuthSession.dismiss();
AuthSession.startAsync({
authUrl: 'url1',
returnUrl: 'url2'
}).then(result => {
switch (result.type) {
case 'success':
result.event;
result.params;
break;
case 'error':
result.errorCode;
result.params;
result.event;
break;
case 'dismissed':
case 'cancel':
result.type;
break;
}
});
AuthSession.startAsync({
authUrl: 'url1',
returnUrl: undefined
});
Audio.setAudioModeAsync({
shouldDuckAndroid: false,
playsInSilentModeIOS: true,
interruptionModeIOS: 2,
interruptionModeAndroid: 1,
allowsRecordingIOS: true
});
Audio.setIsEnabledAsync(true);
Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS === 0;
Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX === 1;
Audio.INTERRUPTION_MODE_IOS_DUCK_OTHERS === 2;
Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX === 1;
Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS === 2;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT === 0;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP === 1;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4 === 2;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB === 3;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB === 4;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF === 5;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS === 6;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP === 7;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS === 8;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM === 9;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT === 0;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB === 1;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB === 2;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC === 3;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC === 4;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD === 5;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS === 6;
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM === 'lpcm';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3 === 'ac-3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3 === 'cac3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4 === 'ima4';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC === 'aac ';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP === 'celp';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC === 'hvxc';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ === 'twvq';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3 === 'MAC3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6 === 'MAC6';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW === 'ulaw';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW === 'alaw';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN === 'QDMC';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2 === 'QDM2';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM === 'Qclp';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1 === '.mp1';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2 === '.mp2';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3 === '.mp3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS === 'alac';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE === 'aach';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD === 'aacl';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD === 'aace';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR === 'aacf';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2 === 'aacg';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2 === 'aacp';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL === 'aacs';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR === 'samr';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB === 'sawb';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE === 'AUDB';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC === 'ilbc';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA === 0x6d730011;
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM === 0x6d730031;
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3 === 'aes3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3 === 'ec-3';
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN === 0;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW === 0x20;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM === 0x40;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH === 0x60;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX === 0x7f;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT === 0;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE === 1;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED === 2;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE === 3;
Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY;
Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY;
async () => {
const result = await Audio.Sound.create({uri: 'uri'}, {
volume: 0.5,
rate: 0.6
}, null, true);
const sound = result.sound;
const status = result.status;
if (!status.isLoaded) {
status.error;
} else {
status.didJustFinish;
// etc.
}
const _status = await sound.getStatusAsync();
await sound.loadAsync({uri: 'uri'});
};
() => (
<AppLoading
startAsync={() => Promise.resolve()}
onFinish={() => {}}
onError={(error) => console.log(error)} />
);
() => (
<AppLoading />
);
const barcodeReadCallback = () => {};
() => (
<BarCodeScanner
type="front"
torchMode="off"
barCodeTypes={[BarCodeScanner.Constants.BarCodeType.aztec]}
onBarCodeRead={barcodeReadCallback} />
);
() => (
<BlurView
tint="dark"
intensity={2} />
);
async () => {
await Brightness.setBrightnessAsync(.6);
await Brightness.setSystemBrightnessAsync(.7);
const br1 = await Brightness.getBrightnessAsync();
const br2 = await Brightness.getSystemBrightnessAsync();
};
Camera.Constants.AutoFocus;
Camera.Constants.Type;
Camera.Constants.FlashMode;
Camera.Constants.WhiteBalance;
Camera.Constants.VideoQuality;
Camera.Constants.BarCodeType;
() => {
return(<Camera ref={(component: any) => {
if (component) {
component.recordAsync();
}
}} />);
};
async () => {
const result = await DocumentPicker.getDocumentAsync();
if (result.type === 'success') {
result.name;
result.uri;
result.size;
}
};
async () => {
const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId");
};
() => (
<FacebookAds.BannerView
type="large"
placementId="str"
onPress={() => {}}
onError={() => {}} />
);
async () => {
const info = await FileSystem.getInfoAsync('file');
info.exists;
info.isDirectory;
if (info.exists) {
info.md5;
info.uri;
info.size;
info.modificationTime;
}
const string: string = await FileSystem.readAsStringAsync('file');
await FileSystem.writeAsStringAsync('file', 'content');
await FileSystem.deleteAsync('file');
await FileSystem.moveAsync({ from: 'from', to: 'to'});
await FileSystem.copyAsync({ from: 'from', to: 'to' });
await FileSystem.makeDirectoryAsync('dir');
const dirs: string[] = await FileSystem.readDirectoryAsync('dir');
const result = await FileSystem.downloadAsync('from', 'to');
result.headers;
result.status;
result.uri;
result.md5;
};
async () => {
// Video test
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
});
if (!result.cancelled) {
result.uri;
result.width;
result.height;
result.duration;
result.type;
}
};
async () => {
// Image test
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images,
base64: true,
aspect: [4, 3],
quality: 1,
exif: true,
});
if (!result.cancelled) {
result.uri;
result.width;
result.height;
result.exif;
result.base64;
result.type;
}
};
async () => {
const result = await ImageManipulator.manipulate('url', {
rotate: 90
}, {
compress: 0.5
});
result.height;
result.uri;
result.width;
};
FaceDetector.Constants.Mode.fast;
FaceDetector.Constants.Mode.accurate;
FaceDetector.Constants.Landmarks.all;
FaceDetector.Constants.Landmarks.none;
FaceDetector.Constants.Classifications.all;
FaceDetector.Constants.Classifications.none;
async () => {
const result = await FaceDetector.detectFaces('url', {
mode: FaceDetector.Constants.Mode.fast,
detectLandmarks: FaceDetector.Constants.Landmarks.all,
runClassifications: FaceDetector.Constants.Classifications.none
});
result.faces[0];
};
() => (
<Svg width={100} height={50}>
<Svg.Rect
x={25}
y={5}
width={150}
height={50}
fill='rgb(0,0,255)'
strokeWidth={3}
stroke='rgb(0,0,0)'
/>
<Svg.Circle
cx={50}
cy={50}
r={50}
fill="pink"
/>
<Svg.Ellipse
cx={55}
cy={55}
rx={50}
ry={30}
stroke="purple"
strokeWidth={2}
fill="yellow"
/>
<Svg.Line
x1={0}
y1={0}
x2={100}
y2={100}
stroke="red"
strokeWidth={2}
/>
<Svg.Polygon
points="40,5 70,80 25,95"
fill="lime"
stroke="purple"
strokeWidth={1}
/>
<Svg.Polyline
points="10,10 20,12 30,20 40,60 60,70 95,90"
fill="none"
stroke="black"
strokeWidth={3}
/>
<Svg.Text
fill="none"
stroke="purple"
fontSize={20}
fontWeight="bold"
x={100}
y={20}
textAnchor="middle"
>
STROKED TEXT
</Svg.Text>
<Svg.Defs>
<Svg.Path
id="path"
d=""
/>
</Svg.Defs>
<Svg.G y={20}>
<Svg.Text fill="blue" >
<Svg.TextPath href="#path" startOffset="-10%">
We go up and down,
<Svg.TSpan fill="red" dy="5,5,5">then up again</Svg.TSpan>
</Svg.TextPath>
</Svg.Text>
<Svg.Path
d=""
fill="none"
stroke="red"
strokeWidth={1}
/>
</Svg.G>
<Svg.Use href="#shape" x="20" y="0" />
<Svg.Symbol id="symbol" viewBox="0 0 150 110" width="100" height="50">
<Svg.Circle cx="50" cy="50" r="40" strokeWidth="8" stroke="red" fill="red"/>
<Svg.Circle cx="90" cy="60" r="40" strokeWidth="8" stroke="green" fill="white"/>
</Svg.Symbol>
<Svg.Defs>
<Svg.ClipPath id="clip">
<Svg.Circle cx="50%" cy="50%" r="40%"/>
</Svg.ClipPath>
<Svg.RadialGradient id="grad" cx="50%" cy="50%" rx="50%" ry="50%" fx="50%" fy="50%" gradientUnits="userSpaceOnUse">
<Svg.Stop
offset="0%"
stopColor="#ff0"
stopOpacity="1"
/>
</Svg.RadialGradient>
<Svg.LinearGradient id="grad" x1="0" y1="0" x2="170" y2="0">
<Svg.Stop offset="1" stopColor="red" stopOpacity="1" />
</Svg.LinearGradient>
</Svg.Defs>
</Svg>
);
IntentLauncherAndroid.ACTION_ACCESSIBILITY_SETTINGS === 'android.settings.ACCESSIBILITY_SETTINGS';
IntentLauncherAndroid.ACTION_APP_NOTIFICATION_REDACTION === 'android.settings.ACTION_APP_NOTIFICATION_REDACTION';
IntentLauncherAndroid.ACTION_CONDITION_PROVIDER_SETTINGS === 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS';
IntentLauncherAndroid.ACTION_NOTIFICATION_LISTENER_SETTINGS === 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS';
IntentLauncherAndroid.ACTION_PRINT_SETTINGS === 'android.settings.ACTION_PRINT_SETTINGS';
IntentLauncherAndroid.ACTION_ADD_ACCOUNT_SETTINGS === 'android.settings.ADD_ACCOUNT_SETTINGS';
IntentLauncherAndroid.ACTION_AIRPLANE_MODE_SETTINGS === 'android.settings.AIRPLANE_MODE_SETTINGS';
IntentLauncherAndroid.ACTION_APN_SETTINGS === 'android.settings.APN_SETTINGS';
IntentLauncherAndroid.ACTION_APPLICATION_DETAILS_SETTINGS === 'android.settings.APPLICATION_DETAILS_SETTINGS';
IntentLauncherAndroid.ACTION_APPLICATION_DEVELOPMENT_SETTINGS === 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS';
IntentLauncherAndroid.ACTION_APPLICATION_SETTINGS === 'android.settings.APPLICATION_SETTINGS';
IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS === 'android.settings.APP_NOTIFICATION_SETTINGS';
IntentLauncherAndroid.ACTION_APP_OPS_SETTINGS === 'android.settings.APP_OPS_SETTINGS';
IntentLauncherAndroid.ACTION_BATTERY_SAVER_SETTINGS === 'android.settings.BATTERY_SAVER_SETTINGS';
IntentLauncherAndroid.ACTION_BLUETOOTH_SETTINGS === 'android.settings.BLUETOOTH_SETTINGS';
IntentLauncherAndroid.ACTION_CAPTIONING_SETTINGS === 'android.settings.CAPTIONING_SETTINGS';
IntentLauncherAndroid.ACTION_CAST_SETTINGS === 'android.settings.CAST_SETTINGS';
IntentLauncherAndroid.ACTION_DATA_ROAMING_SETTINGS === 'android.settings.DATA_ROAMING_SETTINGS';
IntentLauncherAndroid.ACTION_DATE_SETTINGS === 'android.settings.DATE_SETTINGS';
IntentLauncherAndroid.ACTION_DEVICE_INFO_SETTINGS === 'android.settings.DEVICE_INFO_SETTINGS';
IntentLauncherAndroid.ACTION_DEVICE_NAME === 'android.settings.DEVICE_NAME';
IntentLauncherAndroid.ACTION_DISPLAY_SETTINGS === 'android.settings.DISPLAY_SETTINGS';
IntentLauncherAndroid.ACTION_DREAM_SETTINGS === 'android.settings.DREAM_SETTINGS';
IntentLauncherAndroid.ACTION_HARD_KEYBOARD_SETTINGS === 'android.settings.HARD_KEYBOARD_SETTINGS';
IntentLauncherAndroid.ACTION_HOME_SETTINGS === 'android.settings.HOME_SETTINGS';
IntentLauncherAndroid.ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS === 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS';
IntentLauncherAndroid.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS === 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS';
IntentLauncherAndroid.ACTION_INPUT_METHOD_SETTINGS === 'android.settings.INPUT_METHOD_SETTINGS';
IntentLauncherAndroid.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS === 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS';
IntentLauncherAndroid.ACTION_INTERNAL_STORAGE_SETTINGS === 'android.settings.INTERNAL_STORAGE_SETTINGS';
IntentLauncherAndroid.ACTION_LOCALE_SETTINGS === 'android.settings.LOCALE_SETTINGS';
IntentLauncherAndroid.ACTION_LOCATION_SOURCE_SETTINGS === 'android.settings.LOCATION_SOURCE_SETTINGS';
IntentLauncherAndroid.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS';
IntentLauncherAndroid.ACTION_MANAGE_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_APPLICATIONS_SETTINGS';
IntentLauncherAndroid.ACTION_MANAGE_DEFAULT_APPS_SETTINGS === 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS';
IntentLauncherAndroid.ACTION_MEMORY_CARD_SETTINGS === 'android.settings.MEMORY_CARD_SETTINGS';
IntentLauncherAndroid.ACTION_MONITORING_CERT_INFO === 'android.settings.MONITORING_CERT_INFO';
IntentLauncherAndroid.ACTION_NETWORK_OPERATOR_SETTINGS === 'android.settings.NETWORK_OPERATOR_SETTINGS';
IntentLauncherAndroid.ACTION_NFCSHARING_SETTINGS === 'android.settings.NFCSHARING_SETTINGS';
IntentLauncherAndroid.ACTION_NFC_PAYMENT_SETTINGS === 'android.settings.NFC_PAYMENT_SETTINGS';
IntentLauncherAndroid.ACTION_NFC_SETTINGS === 'android.settings.NFC_SETTINGS';
IntentLauncherAndroid.ACTION_NIGHT_DISPLAY_SETTINGS === 'android.settings.NIGHT_DISPLAY_SETTINGS';
IntentLauncherAndroid.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS === 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS';
IntentLauncherAndroid.ACTION_NOTIFICATION_SETTINGS === 'android.settings.NOTIFICATION_SETTINGS';
IntentLauncherAndroid.ACTION_PAIRING_SETTINGS === 'android.settings.PAIRING_SETTINGS';
IntentLauncherAndroid.ACTION_PRIVACY_SETTINGS === 'android.settings.PRIVACY_SETTINGS';
IntentLauncherAndroid.ACTION_QUICK_LAUNCH_SETTINGS === 'android.settings.QUICK_LAUNCH_SETTINGS';
IntentLauncherAndroid.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS === 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS';
IntentLauncherAndroid.ACTION_SECURITY_SETTINGS === 'android.settings.SECURITY_SETTINGS';
IntentLauncherAndroid.ACTION_SETTINGS === 'android.settings.SETTINGS';
IntentLauncherAndroid.ACTION_SHOW_ADMIN_SUPPORT_DETAILS === 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS';
IntentLauncherAndroid.ACTION_SHOW_INPUT_METHOD_PICKER === 'android.settings.SHOW_INPUT_METHOD_PICKER';
IntentLauncherAndroid.ACTION_SHOW_REGULATORY_INFO === 'android.settings.SHOW_REGULATORY_INFO';
IntentLauncherAndroid.ACTION_SHOW_REMOTE_BUGREPORT_DIALOG === 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG';
IntentLauncherAndroid.ACTION_SOUND_SETTINGS === 'android.settings.SOUND_SETTINGS';
IntentLauncherAndroid.ACTION_STORAGE_MANAGER_SETTINGS === 'android.settings.STORAGE_MANAGER_SETTINGS';
IntentLauncherAndroid.ACTION_SYNC_SETTINGS === 'android.settings.SYNC_SETTINGS';
IntentLauncherAndroid.ACTION_SYSTEM_UPDATE_SETTINGS === 'android.settings.SYSTEM_UPDATE_SETTINGS';
IntentLauncherAndroid.ACTION_TETHER_PROVISIONING_UI === 'android.settings.TETHER_PROVISIONING_UI';
IntentLauncherAndroid.ACTION_TRUSTED_CREDENTIALS_USER === 'android.settings.TRUSTED_CREDENTIALS_USER';
IntentLauncherAndroid.ACTION_USAGE_ACCESS_SETTINGS === 'android.settings.USAGE_ACCESS_SETTINGS';
IntentLauncherAndroid.ACTION_USER_DICTIONARY_INSERT === 'android.settings.USER_DICTIONARY_INSERT';
IntentLauncherAndroid.ACTION_USER_DICTIONARY_SETTINGS === 'android.settings.USER_DICTIONARY_SETTINGS';
IntentLauncherAndroid.ACTION_USER_SETTINGS === 'android.settings.USER_SETTINGS';
IntentLauncherAndroid.ACTION_VOICE_CONTROL_AIRPLANE_MODE === 'android.settings.VOICE_CONTROL_AIRPLANE_MODE';
IntentLauncherAndroid.ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE === 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE';
IntentLauncherAndroid.ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE === 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE';
IntentLauncherAndroid.ACTION_VOICE_INPUT_SETTINGS === 'android.settings.VOICE_INPUT_SETTINGS';
IntentLauncherAndroid.ACTION_VPN_SETTINGS === 'android.settings.VPN_SETTINGS';
IntentLauncherAndroid.ACTION_VR_LISTENER_SETTINGS === 'android.settings.VR_LISTENER_SETTINGS';
IntentLauncherAndroid.ACTION_WEBVIEW_SETTINGS === 'android.settings.WEBVIEW_SETTINGS';
IntentLauncherAndroid.ACTION_WIFI_IP_SETTINGS === 'android.settings.WIFI_IP_SETTINGS';
IntentLauncherAndroid.ACTION_WIFI_SETTINGS === 'android.settings.WIFI_SETTINGS';
IntentLauncherAndroid.ACTION_WIRELESS_SETTINGS === 'android.settings.WIRELESS_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_AUTOMATION_SETTINGS === 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_EVENT_RULE_SETTINGS === 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS === 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_PRIORITY_SETTINGS === 'android.settings.ZEN_MODE_PRIORITY_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS === 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_SETTINGS === 'android.settings.ZEN_MODE_SETTINGS';
KeepAwake.activate();
KeepAwake.deactivate();
() => (
<LinearGradient
colors={['#fff']}
start={[1, 1]} />
);
() => (
<LinearGradient
colors={['#fff']}
style={{ flex: 1 }} />
);
Permissions.CAMERA === 'camera';
Permissions.CAMERA_ROLL === 'cameraRoll';
Permissions.AUDIO_RECORDING === 'audioRecording';
Permissions.CONTACTS === 'contacts';
Permissions.NOTIFICATIONS === 'remoteNotifications';
Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications';
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
Permissions.USER_FACING_NOTIFICATIONS === 'userFacingNotifications';
Permissions.REMINDERS === 'reminders';
async () => {
const result = await Permissions.askAsync(Permissions.CAMERA);
result.status === 'granted';
result.status === 'denied';
result.status === 'undetermined';
result.expires === 'never';
};
ScreenOrientation.Orientation.ALL;
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
class __TestEntry__ extends React.Component {
render() {
return(
<Text>test</Text>
);
}
}
registerRootComponent(__TestEntry__);
Calendar.EntityTypes.EVENT === 'event';
Calendar.EntityTypes.REMINDER === 'reminder';
Calendar.CalendarType.LOCAL === 'local';
Calendar.CalendarType.CALDAV === 'caldav';
Calendar.CalendarType.EXCHANGE === 'exchange';
Calendar.CalendarType.SUBSCRIBED === 'subscribed';
Calendar.CalendarType.BIRTHDAYS === 'birthdays';
async () => {
const result = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT);
result.length;
const calendar = result[0];
calendar.id === '';
calendar.title === '';
calendar.sourceId === '';
calendar.type === Calendar.CalendarType.BIRTHDAYS;
calendar.color === '';
calendar.entityType === Calendar.EntityTypes.EVENT;
calendar.allowsModifications === true;
calendar.allowedAvailabilities === [''];
calendar.isPrimary === true;
calendar.name === '';
calendar.ownerAccount === '';
calendar.timeZone === '';
calendar.allowedReminders === [''];
calendar.allowedAttendeeTypes === [''];
calendar.isVisible === false;
calendar.isSynced === false;
calendar.accessLevel === Calendar.CalendarAccessLevel.CONTRIBUTOR;
if (calendar.source) {
calendar.source.id === '';
calendar.source.type === '';
calendar.source.name === '';
calendar.source.isLocalAccount === false;
}
const id1 = await Calendar.createCalendarAsync({
accessLevel: Calendar.CalendarAccessLevel.EDITOR
});
id1 === '';
const id2 = await Calendar.updateCalendarAsync('1234', {
isVisible: false
});
id2 === '';
const id3 = await Calendar.updateCalendarAsync('1234', null);
await Calendar.deleteCalendarAsync('1234');
const events = await Calendar.getEventsAsync(
['123', '124'],
new Date(),
new Date()
);
const event1 = events[0];
event1.accessLevel === Calendar.EventAccessLevel.CONFIDENTIAL;
event1.alarms === [];
event1.allDay === true;
event1.availability === Calendar.Availability.FREE;
event1.calendarId === '';
event1.creationDate === '';
event1.endDate === '';
event1.endTimeZone === '';
event1.guestsCanInviteOthers === true;
event1.guestsCanModify === true;
event1.guestsCanSeeGuests === false;
event1.id === '';
event1.instanceId === '';
event1.isDetached === false;
const event2 = await Calendar.getEventAsync('123', {
futureEvents: true
});
const eventId1 = await Calendar.createEventAsync('123');
const eventId2 = await Calendar.updateEventAsync('1234');
await Calendar.deleteEventAsync('1234');
const attendees = await Calendar.getAttendeesForEventAsync('123');
const aId1 = await Calendar.createAttendeeAsync('123');
const aId2 = await Calendar.updateAttendeeAsync('123');
await Calendar.deleteAttendeeAsync('123');
const reminders = await Calendar.getRemindersAsync(['123']);
const reminder = await Calendar.getReminderAsync('123');
const remId1 = await Calendar.createReminderAsync('123');
const remId2 = await Calendar.updateReminderAsync('123');
await Calendar.deleteReminderAsync('123');
const sources = await Calendar.getSourcesAsync();
const source = await Calendar.getSourceAsync('123');
Calendar.openEventInCalendar('123');
};
async () => {
const result = await MailComposer.composeAsync({
subject: 'sss'
});
result.status === 'saved';
};
async () => {
const updateEventListener: Updates.UpdateEventListener = ({ type, manifest, message }) => {
switch (type) {
case Updates.EventType.DOWNLOAD_STARTED:
case Updates.EventType.DOWNLOAD_PROGRESS:
case Updates.EventType.DOWNLOAD_FINISHED:
case Updates.EventType.NO_UPDATE_AVAILABLE:
case Updates.EventType.ERROR:
return true;
}
};
Updates.reload();
Updates.reloadFromCache();
Updates.addListener(updateEventListener);
const updateCheckResult = await Updates.checkForUpdateAsync();
if (updateCheckResult.isAvailable) {
console.log(updateCheckResult.manifest);
}
Updates.fetchUpdateAsync(updateEventListener);
const bundleFetchResult = await Updates.fetchUpdateAsync();
if (bundleFetchResult.isNew) {
console.log(bundleFetchResult.manifest);
}
};
+2854
View File
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"dom",
"es6"
],
"jsx": "react",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"paths": {
"expo": [
"expo/v26"
],
"expo/*": [
"expo/v26/*"
]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"expo-tests.tsx"
]
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"void-return": false,
"max-line-length": false
}
}
@@ -0,0 +1,26 @@
import globToRegExp = require('glob-to-regexp');
let re = globToRegExp("p*uck");
re.test("pot luck"); // true
re.test("pluck"); // true
re.test("puck"); // true
re = globToRegExp("*.min.js");
re.test("http://example.com/jquery.min.js"); // true
re.test("http://example.com/jquery.min.js.map"); // false
re = globToRegExp("*/www/*.js");
re.test("http://example.com/www/app.js"); // true
re.test("http://example.com/www/lib/factory-proxy-model-observer.js"); // true
// Extended globs
re = globToRegExp("*/www/{*.js,*.html}", { extended: true });
re.test("http://example.com/www/app.js"); // true
re.test("http://example.com/www/index.html"); // true
// globstar
re = globToRegExp("**/www/*", { globstar: true });
re.test("http://example.com/www/index.html"); // true
re.test("http://example.com/www/articles/index.html"); // false
re = globToRegExp("*/www/*", { globstar: true });
re.test("http://example.com/www/index.html"); // false
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for glob-to-regexp 0.4
// Project: https://github.com/fitzgen/glob-to-regexp#readme
// Definitions by: whatasoda <https://github.com/whatasoda>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace GlobToRegExp;
export = GlobToRegExp;
declare function GlobToRegExp(glob: string, options?: GlobToRegExp.Options): RegExp;
declare namespace GlobToRegExp {
interface Options {
extended?: boolean;
globstar?: boolean;
flags ?: string;
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"glob-to-regexp-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+6 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for @google-cloud/pubsub 0.14
// Type definitions for @google-cloud/pubsub 0.18
// Project: https://github.com/GoogleCloudPlatform/google-cloud-node/tree/master/packages/pubsub
// Definitions by: Paul Huynh <https://github.com/pheromonez>
// LunaPg <https://github.com/LunaPg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -13,9 +14,13 @@ declare namespace PubSub {
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/v1
function v1(config?: GCloudConfiguration): any;
/**
* @version: Google PubSub 0.18.0
*/
interface GCloudConfiguration {
projectId?: string;
keyFilename?: string;
apiEndpoint?: string;
email?: string;
credentials?: {
client_email?: string;
@@ -0,0 +1,12 @@
import * as gulp from 'gulp';
import stripComments = require('gulp-strip-comments');
gulp.task('default', () => {
return gulp.src('src/app.js')
.pipe(stripComments({
safe: true,
}))
.pipe(stripComments.html())
.pipe(stripComments.text())
.pipe(gulp.dest('dist'));
});
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for gulp-strip-comments 2.5
// Project: https://github.com/RnbWd/gulp-strip-comments
// Definitions by: Aqours <https://github.com/Aqours>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace stripComments {
interface StripOptions {
safe?: boolean;
ignore?: RegExp | RegExp[];
space?: boolean;
trim?: boolean;
}
interface Strip {
(options?: StripOptions): NodeJS.ReadWriteStream;
text(options?: StripOptions): NodeJS.ReadWriteStream;
html(options?: StripOptions): NodeJS.ReadWriteStream;
getEOL(): string;
}
}
declare const strip: stripComments.Strip;
export = strip;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"gulp-strip-comments-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+23 -23
View File
@@ -376,14 +376,14 @@ declare namespace Office {
*/
asyncContext: any;
/**
* Gets the [AsyncResultStatus](office.asyncresultstatus.md) of the asynchronous operation.
* Gets the {@link Office.AsyncResultStatus} of the asynchronous operation.
*
* @remarks
* Hosts: Access, Excel, Outlook, PowerPoint, Project, Word
*/
status: AsyncResultStatus;
/**
* Gets an [Error](office.error.md) object that provides a description of the error, if any error occurred.
* Gets an {@link Office.Error} object that provides a description of the error, if any error occurred.
*
* @remarks
* Hosts: Access, Excel, Outlook, PowerPoint, Project, Word
@@ -661,7 +661,7 @@ declare namespace Office {
*/
interface Auth {
/**
* Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. Server side code can use this token to access Microsoft Graph for the add-in's web application by using the ["on behalf of" OAuth flow](https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of).
* Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Allows add-ins to identify users. Server side code can use this token to access Microsoft Graph for the add-in's web application by using the {@link https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}.
*
* @remarks
* Hosts: Excel, OneNote, Outlook, PowerPoint, Word
@@ -1459,7 +1459,7 @@ declare namespace Office {
*
* array of arrays: Excel and Word only
*
* [TableData](office.tabledata.md): Access, Excel, and Word only
* {@link Office.TableData}: Access, Excel, and Word only
*
* HTML: Word and Word Online only
*
@@ -2600,7 +2600,7 @@ declare namespace Office {
*
* Available in Requirement set: Not in a set
*
* See [Format tables in add-ins for Excel](https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table) for more information.
* See {@link https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | Format tables in add-ins for Excel} for more information.
*
* @param options Provides an option for preserving context data of any type, unchanged, for use in a callback.
* @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type AsyncResult.
@@ -2692,7 +2692,7 @@ declare namespace Office {
rows: any[][];
}
/**
* Specifies enumerated values for the cells: property in the cellFormat parameter of [table formatting methods](https://dev.office.com/reference/docs/excel/format-tables-in-add-ins-for-excel.htm).
* Specifies enumerated values for the cells: property in the cellFormat parameter of {@link https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | table formatting methods}.
*
* @remarks
* Hosts: Excel
@@ -2787,7 +2787,7 @@ declare namespace Office {
* @remarks
* A ProjectResourceFields constant can be used as a parameter of the getResourceFieldAsync method.
*
* For more information about working with fields in Project, see [Available fields](https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460) reference. In Project Help, search for Available fields.
* For more information about working with fields in Project, see {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In Project Help, search for Available fields.
*/
enum ProjectResourceFields {
/**
@@ -3597,7 +3597,7 @@ declare namespace Office {
* @remarks
* A ProjectTaskFields constant can be used as a parameter of the getTaskFieldAsync method.
*
* For more information about working with fields in Project, see the [Available fields](https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460) reference. In Project Help, search for Available fields.
* For more information about working with fields in Project, see the {@link https://support.office.com/article/Available-fields-reference-615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In Project Help, search for Available fields.
*
* Hosts: Project
*/
@@ -6865,7 +6865,7 @@ declare namespace Office {
*
* In OWA and Outlook, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. However, in iOS and Android, the seriesId returns the REST ID of the parent item.
*
* Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see [Use the Outlook REST APIs from an Outlook add-in](https://docs.microsoft.com/outlook/add-ins/use-rest-api).
* Note: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}.
*
* The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests and returns undefined for any other items that are not meeting requests.
*
@@ -7242,7 +7242,7 @@ declare namespace Office {
*
* @remarks
*
* More information on [actionable messages](https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message).
* More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}.
*
* Minimum permission level: ReadItem
*
@@ -7584,7 +7584,7 @@ declare namespace Office {
*
* @remarks
*
* Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see [Blocked attachments in Outlook](https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519).
* Note: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. For more information, see {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}.
*
* Minimum permission level: ReadItem
*
@@ -7707,7 +7707,7 @@ declare namespace Office {
*/
displayReplyForm(formData: string | ReplyFormData): void;
/**
* Gets initialization data passed when the add-in is [activated by an actionable message](https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message).
* Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}.
*
* Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365.
*
@@ -7725,7 +7725,7 @@ declare namespace Office {
*/
getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
/**
* Gets initialization data passed when the add-in is [activated by an actionable message](https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message).
* Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}.
*
* Note: This method is only supported by Outlook 2016 for Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365.
*
@@ -8270,7 +8270,7 @@ declare namespace Office {
*
* @remarks
*
* The ewsUrl value can be used by a remote service to make EWS calls to the user's mailbox. For example, you can create a remote service to [get attachments from the selected item](https://msdn.microsoft.com/library/office/dn148008.aspx).
* The ewsUrl value can be used by a remote service to make EWS calls to the user's mailbox. For example, you can create a remote service to {@link https://msdn.microsoft.com/library/office/dn148008.aspx | get attachments from the selected item}.
*
* Minimum permission level: ReadItem
*
@@ -8294,7 +8294,7 @@ declare namespace Office {
*
* @remarks
*
* The restUrl value can be used to make [REST API](https://docs.microsoft.com/outlook/rest/) calls to the user's mailbox.
* The restUrl value can be used to make {@link https://docs.microsoft.com/outlook/rest/ | REST API} calls to the user's mailbox.
*
* Minimum permission level: ReadItem
*
@@ -8370,7 +8370,7 @@ declare namespace Office {
*
* @remarks
*
* Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the [Outlook Mail API](https://msdn.microsoft.com/office/office365/APi/mail-rest-operations) or the [Microsoft Graph](http://graph.microsoft.io/)). The convertToRestId method converts an EWS-formatted ID into the proper format for REST.
* Item IDs retrieved via EWS or via the itemId property use a different format than the format used by REST APIs (such as the {@link https://msdn.microsoft.com/office/office365/APi/mail-rest-operations | Outlook Mail API} or the {@link http://graph.microsoft.io/ | Microsoft Graph}. The convertToRestId method converts an EWS-formatted ID into the proper format for REST.
*
* Minimum permission level: Restricted
*
@@ -8585,7 +8585,7 @@ declare namespace Office {
*
* @remarks
*
* The getUserIdentityTokenAsync method returns a token that you can use to identify and [authenticate the add-in and user with a third-party system](https://msdn.microsoft.com/library/office/fp179828.aspx).
* The getUserIdentityTokenAsync method returns a token that you can use to identify and {@link https://msdn.microsoft.com/library/office/fp179828.aspx | authenticate the add-in and user with a third-party system}.
*
* Minimum permission level: ReadItem
*
@@ -9566,7 +9566,7 @@ declare namespace Office {
getDuration(): number;
/**
* Gets the end date of a recurrence pattern in the following [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date format: "YYYY-MM-DD"
* Gets the end date of a recurrence pattern in the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"
*
* [Api set: Mailbox Preview]
*
@@ -9578,7 +9578,7 @@ declare namespace Office {
getEndDate(): string;
/**
* Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or add-in set the recurrence pattern using the following [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format: "THH:mm:ss:mmm"
* Gets the end time of a usual appointment or meeting request instance of a recurrence pattern in whichever time zone that the user or add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm"
*
* [Api set: Mailbox Preview]
*
@@ -9590,7 +9590,7 @@ declare namespace Office {
getEndTime(): string;
/**
* Gets the start date of a recurrence pattern in the following [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date format: "YYYY-MM-DD"
* Gets the start date of a recurrence pattern in the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD"
*
* [Api set: Mailbox Preview]
*
@@ -9602,7 +9602,7 @@ declare namespace Office {
getStartDate(): string;
/**
* Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the recurrence pattern using the following [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format: "THH:mm:ss:mmm"
* Gets the start time of a usual appointment instance of a recurrence pattern in whichever time zone that the user/add-in set the recurrence pattern using the following {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} format: "THH:mm:ss:mmm"
*
* [Api set: Mailbox Preview]
*
@@ -9657,7 +9657,7 @@ declare namespace Office {
*
* Errors: Invalid date format - The date is not in an acceptable format.
*
* @param date End date of the recurring appointment series represented in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date format: "YYYY-MM-DD".
* @param date End date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD".
*/
setEndDate(date: string): void;
@@ -9691,7 +9691,7 @@ declare namespace Office {
*
* Errors: Invalid date format - The date is not in an acceptable format.
*
* @param date Start date of the recurring appointment series represented in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date format: "YYYY-MM-DD".
* @param date Start date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD".
*/
setStartDate(date:string): void;
+3 -1
View File
@@ -19,4 +19,6 @@ export interface CustomTabsOptions {
headers?: any;
}
export function openURL(url: string, options?: CustomTabsOptions): Promise<boolean>;
export namespace CustomTabs {
function openURL(url: string, options?: CustomTabsOptions): Promise<boolean>;
}
@@ -7,4 +7,4 @@ const rnt: ReactNativeCustomTabs.CustomTabsOptions = {
enableDefaultShare: true,
};
const url: Promise<boolean> = ReactNativeCustomTabs.openURL('testurl.com', rnt);
const url: Promise<boolean> = ReactNativeCustomTabs.CustomTabs.openURL('testurl.com', rnt);
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for serialize-error 2.1
// Project: https://github.com/sindresorhus/serialize-error
// Definitions by: Thomas Thiebaud <https://github.com/thomasthiebaud>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function SerializeError(error: any): SerializeError.ErrorObject;
declare namespace SerializeError {
interface ErrorObject {
name: string;
stack: string;
message: string;
[keyof: string]: string;
}
}
export = SerializeError;
@@ -0,0 +1,5 @@
import serializeError = require('serialize-error');
const error = new Error('unicorn');
const serializedError = serializeError(error);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"serialize-error-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+6 -1
View File
@@ -2,6 +2,7 @@
// Project: http://www.w3.org/TR/workers/
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
declare namespace SharedWorker {
interface AbstractWorker extends EventTarget {
@@ -16,6 +17,10 @@ declare namespace SharedWorker {
*/
port: MessagePort;
}
export interface SharedWorkerGlobalScope extends Worker {
onconnect: (event: MessageEvent) => void;
}
}
declare var SharedWorker: {
@@ -25,5 +30,5 @@ declare var SharedWorker: {
* @param {string} stringUrl Pathname to JavaScript file
* @param {string} name Name of the worker to execute
*/
new (stringUrl: string, name?: string): SharedWorker.SharedWorker;
new(stringUrl: string, name?: string): SharedWorker.SharedWorker;
};
+22 -4
View File
@@ -1,7 +1,25 @@
var worker_with_name = new SharedWorker('worker.js', "worker");
var worker = new SharedWorker('worker.js');
/* Caller */
let worker = new SharedWorker('worker.js');
worker.port.start();
worker.port.onmessage = function(e) {
console.log(e);
};
worker.port.onmessage = function (e) {
console.log('Caller Received:', e.data);
}
worker.port.postMessage('Message');
/* Worker */
const _self: SharedWorker.SharedWorkerGlobalScope = self as any;
_self.onconnect = function (e) {
var port = e.ports[0];
port.addEventListener('message', function (e) {
console.log('Worker Received', e.data);
port.postMessage('Result');
});
port.start();
}
+40
View File
@@ -0,0 +1,40 @@
export interface ABIDefinition {
constant?: boolean;
payable?: boolean;
anonymous?: boolean;
inputs?: Array<{ name: string; type: ABIDataTypes; indexed?: boolean }>;
name?: string;
outputs?: Array<{ name: string; type: ABIDataTypes }>;
type: "function" | "constructor" | "event" | "fallback";
}
type ABIDataTypes = "uint256" | "boolean" | "string" | "bytes" | string; // TODO complete list
export default interface ABI {
decodeLog(inputs: object, hexString: string, topics: string[]): object;
encodeParameter(type: string, parameter: any): string;
encodeParameters(types: string[], paramaters: any[]): string;
encodeEventSignature(name: string | object): string;
encodeFunctionCall(jsonInterface: object, parameters: any[]): string;
encodeFunctionSignature(name: string | object): string;
decodeParameter(type: string, hex: string): any;
decodeParameters(
types: string[],
hex: string
): EthAbiDecodeParametersResultArray;
decodeParameters(
types: EthAbiDecodeParametersType[],
hex: string
): EthAbiDecodeParametersResultObject;
}
interface EthAbiDecodeParametersType {
name: string;
type: string;
}
interface EthAbiDecodeParametersResultArray {
[index: number]: any;
}
type EthAbiDecodeParametersResultObject = EthAbiDecodeParametersResultArray & {
[key: string]: any;
};
+71
View File
@@ -0,0 +1,71 @@
import { Tx } from "./types";
export interface Account {
address: string;
privateKey: string;
publicKey: string;
}
export interface Signature {
message: string;
hash: string;
r: string;
s: string;
v: string;
}
export interface PrivateKey {
address: string;
Crypto: {
cipher: string;
ciphertext: string;
cipherparams: {
iv: string;
};
kdf: string;
kdfparams: {
dklen: number;
n: number;
p: number;
r: number;
salt: string;
};
mac: string;
};
id: string;
version: number;
}
export default interface Accounts {
create(entropy?: string): Account;
privateKeyToAccount(privKey: string): Account;
publicToAddress(key: string): string;
signTransaction(
tx: Tx,
privateKey: string,
returnSignature?: boolean,
cb?: (err: Error, result: string | Signature) => void
): Promise<string> | Signature;
recoverTransaction(signature: string | Signature): string;
sign(
data: string,
privateKey: string,
returnSignature?: boolean
): string | Signature;
recover(
sigOrHash: string | Signature,
sigOrV?: string,
r?: string,
s?: string
): string;
encrypt(privateKey: string, password: string): PrivateKey;
decrypt(privateKey: PrivateKey, password: string): Account;
wallet: {
create(numberOfAccounts: number, entropy: string): Account[];
add(account: string | Account): any;
remove(account: string | number): any;
save(password: string, keyname?: string): string;
load(password: string, keyname: string): any;
clear(): any;
};
}
+68
View File
@@ -0,0 +1,68 @@
import { Callback, EventLog, EventEmitter } from "../types";
import { TransactionObject, BlockType } from "./types";
import { ABIDefinition } from "./abi";
import BigNumber = require("bn.js");
import { Provider } from "../providers";
interface CustomOptions {
address?: string;
jsonInterface?: ABIDefinition[];
data?: string;
from?: string;
gasPrice?: string;
gas?: number;
}
interface contractOptions {
address: string;
jsonInterface: ABIDefinition[];
data: string;
from: string;
gasPrice: string;
gas: number;
}
export default class Contract {
constructor(
jsonInterface: any[],
address?: string,
options?: CustomOptions
);
options: contractOptions;
methods: {
[fnName: string]: (...args: any[]) => TransactionObject<any>;
};
deploy(options: {
data: string;
arguments: any[];
}): TransactionObject<Contract>;
events: {
[eventName: string]: (
options?: {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
},
cb?: Callback<EventLog>
) => EventEmitter;
allEvents: (
options?: {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
},
cb?: Callback<EventLog>
) => EventEmitter;
};
getPastEvents(
event: string,
options?: {
filter?: object;
fromBlock?: BlockType;
toBlock?: BlockType;
topics?: string[];
},
cb?: Callback<EventLog[]>
): Promise<EventLog[]>;
setProvider(provider: Provider): void;
}
+185
View File
@@ -0,0 +1,185 @@
import BigNumber = require("bn.js");
import { Provider } from "../providers";
import Contract, { CustomOptions as CustomContractOptions } from "./contract";
import PromiEvent from "../promiEvent";
import ABI from "./abi";
import Accounts from "./accounts";
import {
BatchRequest,
Iban,
BlockHeader,
CompileResult,
Block,
Transaction,
Tx,
BlockType,
Net,
Personal
} from "./types";
import {
Callback,
TransactionReceipt,
Logs,
Log,
Subscribe,
EncodedTransaction
} from "../types";
export default interface Eth {
defaultAccount: string;
defaultBlock: BlockType;
BatchRequest: new () => BatchRequest;
Iban: Iban;
Contract: new (
jsonInterface: any[],
address?: string,
options?: CustomContractOptions
) => Contract;
abi: ABI;
setProvider: (provider: Provider) => void;
accounts: Accounts;
call(
callObject: Tx,
defaultBloc?: BlockType,
callBack?: Callback<string>
): Promise<string>;
clearSubscriptions(): boolean;
subscribe(
type: "logs",
options?: Logs,
callback?: Callback<Subscribe<Log>>
): Promise<Subscribe<Log>>;
subscribe(
type: "syncing",
callback?: Callback<Subscribe<any>>
): Promise<Subscribe<any>>;
subscribe(
type: "newBlockHeaders",
callback?: Callback<Subscribe<BlockHeader>>
): Promise<Subscribe<BlockHeader>>;
subscribe(
type: "pendingTransactions",
callback?: Callback<Subscribe<Transaction>>
): Promise<Subscribe<Transaction>>;
subscribe(
type: "pendingTransactions" | "newBlockHeaders" | "syncing" | "logs",
options?: Logs,
callback?: Callback<Subscribe<any>>
): Promise<Subscribe<any>>;
unsubscribe(callBack: Callback<boolean>): void | boolean;
compile: {
solidity(
source: string,
callback?: Callback<CompileResult>
): Promise<CompileResult>;
lll(
source: string,
callback?: Callback<CompileResult>
): Promise<CompileResult>;
serpent(
source: string,
callback?: Callback<CompileResult>
): Promise<CompileResult>;
};
currentProvider: Provider;
estimateGas(tx: Tx, callback?: Callback<number>): Promise<number>;
getAccounts(cb?: Callback<string[]>): Promise<string[]>;
getBalance(
address: string,
defaultBlock?: BlockType,
cb?: Callback<number>
): Promise<number>;
getBlock(
number: BlockType,
returnTransactionObjects?: boolean,
cb?: Callback<Block>
): Promise<Block>;
getBlockNumber(callback?: Callback<number>): Promise<number>;
getBlockTransactionCount(
number: BlockType | string,
cb?: Callback<number>
): Promise<number>;
getBlockUncleCount(
number: BlockType | string,
cb?: Callback<number>
): Promise<number>;
getCode(
address: string,
defaultBlock?: BlockType,
cb?: Callback<string>
): Promise<string>;
getCoinbase(cb?: Callback<string>): Promise<string>;
getCompilers(cb?: Callback<string[]>): Promise<string[]>;
getGasPrice(cb?: Callback<number>): Promise<number>;
getHashrate(cb?: Callback<number>): Promise<number>;
getPastLogs(
options: {
fromBlock?: BlockType;
toBlock?: BlockType;
address: string;
topics?: Array<string | string[]>;
},
cb?: Callback<Log[]>
): Promise<Log[]>;
getProtocolVersion(cb?: Callback<string>): Promise<string>;
getStorageAt(
address: string,
defaultBlock?: BlockType,
cb?: Callback<string>
): Promise<string>;
getTransactionReceipt(
hash: string,
cb?: Callback<TransactionReceipt>
): Promise<TransactionReceipt>;
getTransaction(
hash: string,
cb?: Callback<Transaction>
): Promise<Transaction>;
getTransactionCount(
address: string,
defaultBlock?: BlockType,
cb?: Callback<number>
): Promise<number>;
getTransactionFromBlock(
block: BlockType,
index: number,
cb?: Callback<Transaction>
): Promise<Transaction>;
getUncle(
blockHashOrBlockNumber: BlockType | string,
uncleIndex: number,
returnTransactionObjects?: boolean,
cb?: Callback<Block>
): Promise<Block>;
getWork(cb?: Callback<string[]>): Promise<string[]>;
givenProvider: Provider;
isMining(cb?: Callback<boolean>): Promise<boolean>;
isSyncing(cb?: Callback<boolean>): Promise<boolean>;
net: Net;
personal: Personal;
signTransaction(
tx: Tx,
address?: string,
cb?: Callback<string>
): Promise<EncodedTransaction>;
sendSignedTransaction(
data: string,
cb?: Callback<string>
): PromiEvent<TransactionReceipt>;
sendTransaction(
tx: Tx,
cb?: Callback<string>
): PromiEvent<TransactionReceipt>;
submitWork(
nonce: string,
powHash: string,
digest: string,
cb?: Callback<boolean>
): Promise<boolean>;
sign(
address: string,
dataToSign: string,
cb?: Callback<string>
): Promise<string>;
}
+100
View File
@@ -0,0 +1,100 @@
import { Callback, EventLog } from "../types";
import PromiEvent from "../promiEvent";
import { ABIDefinition } from "./abi";
export interface Tx {
nonce?: string | number;
chainId?: string | number;
from?: string;
to?: string;
data?: string;
value?: string | number;
gas?: string | number;
gasPrice?: string | number;
}
export class BatchRequest {
constructor();
add(request: object): void; //
execute(): void;
}
export class Iban {
constructor(address: string);
static toAddress(iban: Iban): string;
isValid(): boolean;
}
export type BlockType = "latest" | "pending" | "genesis" | number;
export interface BlockHeader {
number: number;
hash: string;
parentHash: string;
nonce: string;
sha3Uncles: string;
logsBloom: string;
transactionRoot: string;
stateRoot: string;
receiptRoot: string;
miner: string;
extraData: string;
gasLimit: number;
gasUsed: number;
timestamp: number;
}
export interface Block extends BlockHeader {
transactions: Transaction[];
size: number;
difficulty: number;
totalDifficulty: number;
uncles: string[];
}
export class Net {
getId(cb?: Callback<number>): Promise<number>;
isListening(cb?: Callback<boolean>): Promise<boolean>;
getPeerCount(cb?: Callback<number>): Promise<number>;
}
export class Personal {
newAccount(password: string, cb?: Callback<boolean>): Promise<string>;
importRawKey(): Promise<string>;
lockAccount(): Promise<boolean>;
unlockAccount(): void;
sign(): Promise<string>;
ecRecover(message: string, sig: string): void;
sendTransaction(tx: Tx, passphrase: string): Promise<string>;
}
export interface Transaction {
hash: string;
nonce: number;
blockHash: string;
blockNumber: number;
transactionIndex: number;
from: string;
to: string;
value: string;
gasPrice: string;
gas: number;
input: string;
v?: string;
r?: string;
s?: string;
}
export interface TransactionObject<T> {
arguments: any[];
call(tx?: Tx): Promise<T>;
send(tx?: Tx): PromiEvent<T>;
estimateGas(tx?: Tx): Promise<number>;
encodeABI(): string;
}
export interface CompileResult {
code: string;
info: {
source: string;
language: string;
languageVersion: string;
compilerVersion: string;
abiDefinition: ABIDefinition[];
};
userDoc: { methods: object };
developerDoc: { methods: object };
}
+50
View File
@@ -0,0 +1,50 @@
// Type definitions for web3 1.0
// Project: https://github.com/ethereum/web3.js
// Definitions by: Simon Jentzsch <https://github.com/simon-jentzsch>
// Nitzan Tomer <https://github.com/nitzantomer>
// Zurbo <https://github.com/zurbo>
// Xiao Liang <https://github.com/yxliang01>
// Francesco Soncina <https://github.com/phra>
// Nick Addison <https://github.com/naddison36>
// Ícaro Harry <https://github.com/icaroharry>
// Linus Norton <https://github.com/linusnorton>
// Javier Peletier <https://github.com/jpeletier>
// HIKARU KOBORI <https://github.com/anneau>
// Baris Gumustas <https://github.com/matrushka>
// André Vitor de Lima Matos <https://github.com/andrevmatos>
// Levin Keller <https://github.com/levino>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import BigNumber = require("bn.js");
import Providers, { Provider } from "./providers";
import Contract from "./eth/contract";
import { Callback, Bzz, Shh } from "./types";
import { BatchRequest, Net, Personal } from "./eth/types";
import Utils from "./utils";
import Eth from "./eth/index";
declare class Web3 {
static providers: Providers;
static givenProvider: Provider;
static modules: {
Eth: new (provider: Provider) => Eth;
Net: new (provider: Provider) => Net;
Personal: new (provider: Provider) => Personal;
Shh: new (provider: Provider) => Shh;
Bzz: new (provider: Provider) => Bzz;
};
constructor(provider?: Provider | string);
version: string;
BatchRequest: new () => BatchRequest;
extend(methods: any): any; // TODO
bzz: Bzz;
currentProvider: Provider;
eth: Eth;
ssh: Shh;
givenProvider: Provider;
providers: Providers;
setProvider(provider: Provider): void;
utils: Utils;
}
export = Web3;
+40
View File
@@ -0,0 +1,40 @@
import { TransactionReceipt } from "./types";
type PromiEventType = "transactionHash" | "receipt" | "confirmation" | "error";
export default interface PromiEvent<T> extends Promise<T> {
once(
type: "transactionHash",
handler: (receipt: string) => void
): PromiEvent<T>;
once(
type: "receipt",
handler: (receipt: TransactionReceipt) => void
): PromiEvent<T>;
once(
type: "confirmation",
handler: (confNumber: number, receipt: TransactionReceipt) => void
): PromiEvent<T>;
once(type: "error", handler: (error: Error) => void): PromiEvent<T>;
once(
type: PromiEventType,
handler: (error: Error | TransactionReceipt | string) => void
): PromiEvent<T>;
on(
type: "transactionHash",
handler: (receipt: string) => void
): PromiEvent<T>;
on(
type: "receipt",
handler: (receipt: TransactionReceipt) => void
): PromiEvent<T>;
on(
type: "confirmation",
handler: (confNumber: number, receipt: TransactionReceipt) => void
): PromiEvent<T>;
on(type: "error", handler: (error: Error) => void): PromiEvent<T>;
on(
type: "error" | "confirmation" | "receipt" | "transactionHash",
handler: (error: Error | TransactionReceipt | string) => void
): PromiEvent<T>;
}
+64
View File
@@ -0,0 +1,64 @@
interface JsonRPCRequest {
jsonrpc: string;
method: string;
params: any[];
id: number;
}
interface JsonRPCResponse {
jsonrpc: string;
id: number;
result?: any;
error?: string;
}
export class Provider {
send(
payload: JsonRPCRequest,
callback: (e: Error, val: JsonRPCResponse) => void
): any;
}
export class WebsocketProvider extends Provider {
responseCallbacks: object;
notificationCallbacks: [() => any];
connection: {
onclose(e: any): void;
onmessage(e: any): void;
onerror(e?: any): void;
};
addDefaultEvents: () => void;
on(type: string, callback: () => any): void;
removeListener(type: string, callback: () => any): void;
removeAllListeners(type: string): void;
reset(): void;
}
export class HttpProvider extends Provider {
responseCallbacks: undefined;
notificationCallbacks: undefined;
connection: undefined;
addDefaultEvents: undefined;
on(type: string, callback: () => any): undefined;
removeListener(type: string, callback: () => any): undefined;
removeAllListeners(type: string): undefined;
reset(): undefined;
}
export class IpcProvider extends Provider {
responseCallbacks: undefined;
notificationCallbacks: undefined;
connection: undefined;
addDefaultEvents: undefined;
on(type: string, callback: () => any): undefined;
removeListener(type: string, callback: () => any): undefined;
removeAllListeners(type: string): undefined;
reset(): undefined;
}
export default interface Providers {
WebsocketProvider: new (
host: string,
timeout?: number
) => WebsocketProvider;
HttpProvider: new (host: string, timeout?: number) => HttpProvider;
IpcProvider: new (path: string, net: any) => IpcProvider;
}
+28
View File
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"promiEvent.d.ts",
"providers.d.ts",
"types.d.ts",
"utils.d.ts",
"web3-tests.ts",
"eth/abi.d.ts",
"eth/accounts.d.ts",
"eth/contract.d.ts",
"eth/index.d.ts",
"eth/types.d.ts"
]
}
+5
View File
@@ -0,0 +1,5 @@
{ "extends": "dtslint/dt.json",
"rules": {
"strict-export-declare-modifiers": false
}
}
+89
View File
@@ -0,0 +1,89 @@
import BigNumber = require("bn.js");
import * as us from "underscore";
import PromiEvent from "./promiEvent";
import { ABIDefinition } from "./eth/abi";
export type Callback<T> = (error: Error, result: T) => void;
export interface EventEmitter {
on(type: "data", handler: (event: EventLog) => void): EventEmitter;
on(type: "changed", handler: (receipt: EventLog) => void): EventEmitter;
on(type: "error", handler: (error: Error) => void): EventEmitter;
on(
type: "error" | "data" | "changed",
handler: (error: Error | TransactionReceipt | string) => void
): EventEmitter;
}
export interface EventLog {
event: string;
address: string;
returnValues: any;
logIndex: number;
transactionIndex: number;
transactionHash: string;
blockHash: string;
blockNumber: number;
raw?: { data: string; topics: string[] };
}
export interface TransactionReceipt {
transactionHash: string;
transactionIndex: number;
blockHash: string;
blockNumber: number;
from: string;
to: string;
contractAddress: string;
cumulativeGasUsed: number;
gasUsed: number;
logs?: Log[];
events?: {
[eventName: string]: EventLog;
};
status: string;
}
export interface EncodedTransaction {
raw: string;
tx: {
nonce: string;
gasPrice: string;
gas: string;
to: string;
value: string;
input: string;
v: string;
r: string;
s: string;
hash: string;
};
}
export interface Logs {
fromBlock?: number;
address?: string;
topics?: Array<string | string[]>;
}
export interface Log {
address: string;
data: string;
topics: string[];
logIndex: number;
transactionHash: string;
transactionIndex: number;
blockHash: string;
blockNumber: number;
}
export interface Subscribe<T> {
subscription: {
id: string;
subscribe(callback?: Callback<Subscribe<T>>): Subscribe<T>;
unsubscribe(callback?: Callback<boolean>): void | boolean;
arguments: object;
};
on(type: "data" | "changed", handler: (data: T) => void): void;
on(type: "error", handler: (data: Error) => void): void;
}
export class Shh {} // TODO: Type
export class Bzz {} // TODO: Type
+71
View File
@@ -0,0 +1,71 @@
import BigNumber = require("bn.js");
import * as us from "underscore";
type Unit =
| "kwei"
| "femtoether"
| "babbage"
| "mwei"
| "picoether"
| "lovelace"
| "qwei"
| "nanoether"
| "shannon"
| "microether"
| "szabo"
| "nano"
| "micro"
| "milliether"
| "finney"
| "milli"
| "ether"
| "kether"
| "grand"
| "mether"
| "gether"
| "tether";
export default interface Utils {
BN: BigNumber; // TODO only static-definition
isBN(any: any): boolean;
isBigNumber(any: any): boolean;
isAddress(any: any): boolean;
isHex(any: any): boolean;
_: us.UnderscoreStatic;
asciiToHex(val: string): string;
hexToAscii(val: string): string;
bytesToHex(val: number[]): string;
numberToHex(val: number | BigNumber): string;
checkAddressChecksum(address: string): boolean;
fromAscii(val: string): string;
fromDecimal(val: string | number | BigNumber): string;
fromUtf8(val: string): string;
fromWei(val: string | number | BigNumber, unit: Unit): string | BigNumber;
hexToBytes(val: string): number[];
hexToNumber(val: string | number | BigNumber): number;
hexToNumberString(val: string | number | BigNumber): string;
hexToString(val: string): string;
hexToUtf8(val: string): string;
keccak256(val: string): string;
leftPad(string: string, chars: number, sign: string): string;
padLeft(string: string, chars: number, sign: string): string;
rightPad(string: string, chars: number, sign: string): string;
padRight(string: string, chars: number, sign: string): string;
sha3(
val: string,
val2?: string,
val3?: string,
val4?: string,
val5?: string
): string;
soliditySha3(val: string): string;
randomHex(bytes: number): string;
stringToHex(val: string): string;
toAscii(hex: string): string;
toBN(any: any): BigNumber;
toChecksumAddress(val: string): string;
toDecimal(val: any): number;
toHex(val: any): string;
toUtf8(val: any): string;
toWei(val: string | number | BigNumber, unit: Unit): string | BigNumber;
unitMap: any;
}
+18
View File
@@ -0,0 +1,18 @@
import Web3 = require("web3");
const web3 = new Web3();
const myProvider = new web3.providers.HttpProvider("http://localhost:5454");
web3.setProvider(myProvider);
web3.eth.setProvider(myProvider);
const myContract = new web3.eth.Contract(
[],
"0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe",
{
from: "0x1234567890123456789012345678901234567891",
gasPrice: "20000000000"
}
);
myContract.options.from = "0x1234567890123456789012345678901234567891";
myContract.options.gasPrice = "20000000000000";
myContract.options.gas = 5000000;