From f305105c139273a1d79048dcfce618ab75172cc7 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Fri, 29 Jul 2016 00:23:13 +0900 Subject: [PATCH 1/8] Sleep (#10333) --- sleep/sleep-tests.ts | 6 ++++++ sleep/sleep.d.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sleep/sleep-tests.ts create mode 100644 sleep/sleep.d.ts diff --git a/sleep/sleep-tests.ts b/sleep/sleep-tests.ts new file mode 100644 index 0000000000..2d2c05c2ff --- /dev/null +++ b/sleep/sleep-tests.ts @@ -0,0 +1,6 @@ +/// + +import sleep = require("sleep"); + +sleep.sleep(1); +sleep.usleep(5000); \ No newline at end of file diff --git a/sleep/sleep.d.ts b/sleep/sleep.d.ts new file mode 100644 index 0000000000..5173e4b4ef --- /dev/null +++ b/sleep/sleep.d.ts @@ -0,0 +1,26 @@ +// Type definitions for node-scanf +// Project: https://github.com/ErikDubbelboer/node-sleep +// Definitions by: Jeongho Nam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace __node_sleep +{ + /** + * Sleep for n seconds. + * + * @param n Number of seconds to sleep. + */ + function sleep(n: number): void; + + /** + * Sleep for n microseconds. + * + * @param n Number of microseconds to sleep; 1 second is 1,000,000 microseconds. + */ + function usleep(n: number): void; +} + +declare module "sleep" +{ + export = __node_sleep; +} \ No newline at end of file From bf140ce89a657bc18596cc909c991e3688481c28 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 28 Jul 2016 17:24:22 +0200 Subject: [PATCH 2/8] Add Electron specific versions to process.versions (#10320) --- github-electron/github-electron-main-tests.ts | 2 ++ github-electron/github-electron.d.ts | 12 ++++++++++ node/node.d.ts | 22 ++++++++++--------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 9f79e6590f..0b928138e4 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -766,6 +766,8 @@ let image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png'); // process // https://github.com/electron/electron/blob/master/docs/api/process.md +console.log(process.versions.electron); +console.log(process.versions.chrome); console.log(process.type); console.log(process.resourcesPath); console.log(process.mas); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 217e230d9c..0cd51c1601 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -5107,6 +5107,18 @@ interface File { // https://github.com/electron/electron/blob/master/docs/api/process.md declare namespace NodeJS { + + interface ProcessVersions { + /** + * Electron's version string. + */ + electron: string; + /** + * Chrome's version string. + */ + chrome: string; + } + interface Process { /** * Setting this to true can disable the support for asar archives in Node's built-in modules. diff --git a/node/node.d.ts b/node/node.d.ts index bad534cdd7..359f1679c5 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -301,6 +301,17 @@ declare namespace NodeJS { heapUsed: number; } + export interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + export interface Process extends EventEmitter { stdout: WritableStream; stderr: WritableStream; @@ -320,16 +331,7 @@ declare namespace NodeJS { setuid(id: number): void; setuid(id: string): void; version: string; - versions: { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - }; + versions: ProcessVersions; config: { target_defaults: { cflags: any[]; From 85ea13a9863bbe73e9f3c5d0313de822bfd1cc87 Mon Sep 17 00:00:00 2001 From: Eugene Oskin Date: Thu, 28 Jul 2016 21:26:00 +0600 Subject: [PATCH 3/8] Fix uuid.js definitions. (#10318) --- uuid/UUID-tests.ts | 4 ---- uuid/UUID.d.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/uuid/UUID-tests.ts b/uuid/UUID-tests.ts index ce40ddee15..990354525c 100644 --- a/uuid/UUID-tests.ts +++ b/uuid/UUID-tests.ts @@ -1,9 +1,5 @@ /// - -import UUID = require("UUID"); - - const uuid1: string = UUID.generate() const uuid2: UUID.UUID = UUID.genV4() const uuid3: UUID.UUID = UUID.genV1() diff --git a/uuid/UUID.d.ts b/uuid/UUID.d.ts index 164cf503c8..4526506120 100644 --- a/uuid/UUID.d.ts +++ b/uuid/UUID.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jason Jarrett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "UUID" { +declare module UUID { interface UUID { intFields: UUIDArray; From ea0b9196a6a66463de5ad3f6562195431d1a1780 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Thu, 28 Jul 2016 17:26:20 +0200 Subject: [PATCH 4/8] protobufjs: updated Message interfaces (#10198) * protobufjs: updated Message interfaces * Added ProtoBuf.Util interface * Fixed load functions of ProtoBuf namespace Base on the protobuf.js API docmentation. * use {} instead of Object Fixed according to PR commit note. --- protobufjs/protobufjs-tests.ts | 5 ++- protobufjs/protobufjs.d.ts | 71 +++++++++++++++++++++++++--------- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/protobufjs/protobufjs-tests.ts b/protobufjs/protobufjs-tests.ts index 94afba0a8e..fd29685f15 100644 --- a/protobufjs/protobufjs-tests.ts +++ b/protobufjs/protobufjs-tests.ts @@ -44,7 +44,7 @@ function testProtoBufJs() { assertIsNamespace(protoFile.ns, "protoFile.ns"); assertIsNamespace(protoFile.ptr, "protoFile.ptr"); - assertIsProtoBuf(protoFile.build(), "protoFile.build()"); + assertIsMetaMessage(protoFile.build(), "protoFile.build()"); assertIsProtoBuf(protoFile.result, "protoFile.result"); assertIsProtoBuilder(protoFile.create(), "protoFile.create()"); @@ -117,11 +117,12 @@ function assertIsProtoBuf(pb: ProtoBuf.ProtoBuf, name: string) { } } -function assertIsMetaMessage(mm: ProtoBuf.MetaMessage, name: string) { +function assertIsMetaMessage(mm: ProtoBuf.MetaMessage, name: string) { assert.ok("decode" in mm, name + " should contain property decode"); assert.ok("decodeDelimited" in mm, name + " should contain property decodeDelimited"); assert.ok("decode64" in mm, name + " should contain property decode64"); assert.ok("decodeHex" in mm, name + " should contain property decodeHex"); + assert.ok("decodeJSON" in mm, name + " should contain property decodeJSON"); } function assertIsDotProto(dp: ProtoBuf.DotProto, name: string) { diff --git a/protobufjs/protobufjs.d.ts b/protobufjs/protobufjs.d.ts index 77d457fbbf..fac34be103 100644 --- a/protobufjs/protobufjs.d.ts +++ b/protobufjs/protobufjs.d.ts @@ -1,8 +1,9 @@ -// Type definitions for ProtoBuf.js +// Type definitions for ProtoBuf.js 5.0.1 // Project: https://github.com/dcodeIO/ProtoBuf.js // Definitions by: Panu Horsmalahti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// /// declare namespace ProtoBuf { @@ -10,25 +11,24 @@ declare namespace ProtoBuf { // protobufjs/src/ProtoBuf.js var Builder: Builder; - var ByteBuffer: Buffer; var Long: LongStatic; var DotProto: DotProto; var Reflect: Reflect; + var Util: Util; // var Lang: Lang; TODO: implement interface Lang - // var Util: Util; TODO: implement interface Util - export function loadJson(json: string, builder?: ProtoBuilder, - filename?: string): ProtoBuilder; + export function loadJson(json: string, builder?: ProtoBuilder | string | {}, + filename?: string | {}): ProtoBuilder; - export function loadJsonFile(filename: string, + export function loadJsonFile(filename: string | {}, callback?: (error: any, builder: ProtoBuilder) => void, builder?: ProtoBuilder): ProtoBuilder; - export function loadProto(proto: string, builder?: ProtoBuilder, - filename?: string): ProtoBuilder; + export function loadProto(proto: string, builder?: ProtoBuilder | string | {}, + filename?: string | {}): ProtoBuilder; - export function loadProtoFile(filePath: string, + export function loadProtoFile(filePath: string | {}, callback?: (error: any, builder: ProtoBuilder) => void, builder?: ProtoBuilder): ProtoBuilder; @@ -117,6 +117,26 @@ declare namespace ProtoBuf { */ export interface Message { new(values?: {[key: string]: any}, var_args?: string[]): Message; + $add(key: string, value: any, noAssert?: boolean): Message; + $get(key: string): T; + $set(key: string | {[key: string]: any}, value?: any | boolean, noAssert?: boolean): void; + add(key: string, value: any, noAssert?: boolean): Message; + calculate(): number; + encode(buffer?: ByteBuffer | boolean, noVerify?: boolean): ByteBuffer; + encode64(): string; + encodeAB(): ArrayBuffer; + encodeNB(): Buffer; + encodeHex(): string; + encodeJSON(): string; + encodeDelimited(buffer?: ByteBuffer | boolean, noVerify?: boolean): ByteBuffer; + get(key: string, noAssert?: boolean): T; + set(key: string | {[key: string]: any}, value?: any | boolean, noAssert?: boolean): void; + toArrayBuffer(): ArrayBuffer; + toBase64(): string; + toBuffer(): Buffer; + toHex(): string; + toRaw(binaryAsBase64?: boolean, longsAsStrings?: boolean): {[key: string]: any}; + toString(): string; [field: string]: any; } @@ -144,20 +164,22 @@ declare namespace ProtoBuf { define(pkg: string, options?: {[key: string]: any}): ProtoBuilder; create(defs?: {[key: string]: any}[]): ProtoBuilder; resolveAll(): void; - build(path?: string): ProtoBuf; + build(path?: string | [string]): MetaMessage; + build(path?: string | [string]): MetaMessage; lookup(path?: string): ReflectT; } export interface ProtoBuf { - [package: string]: {[key: string]: MetaMessage | any}; + [package: string]: {[key: string]: MetaMessage | any}; } - export interface MetaMessage { - new(values?: {[key: string]: any}, var_args?: string[]): Message; - decode(buffer?: Buffer, enc?: string): Message; - decodeDelimited(buffer?: Buffer, enc?: string): Message; - decode64(str: string): Message; - decodeHex(str: string): Message; + export interface MetaMessage { + new(values?: {[key: string]: any}, var_args?: string[]): T & Message; + decode(buffer: ArrayBuffer | ByteBuffer | Buffer | string, length?: number | string, enc?: string): T & Message; + decodeDelimited(buffer: ByteBuffer | ArrayBuffer | Buffer | string, enc?: string): T & Message; + decode64(str: string): T & Message; + decodeHex(str: string): T & Message; + decodeJSON(str: string): T & Message; } // ========== @@ -242,6 +264,16 @@ declare namespace ProtoBuf { options: {[key: string]: any}; } + // ========== + // protobufjs/src/ProtoBuf/Util.js + + export interface Util { + IS_NODE: boolean + fetch(path: string, callback?: (data: string) => any): string; + toCamelCase(str: string): string; + XHR(): XMLHttpRequest; + } + // ========== // protobufjs/src/ProtoBuf/Reflect.js @@ -288,9 +320,10 @@ declare namespace ProtoBuf { // new ProtoBuf.Reflect.Message.ExtensionField(); OneOf: ReflectOneOf; // NOTE: only for new ProtoBuf.Reflect.Message.OneOf(); extensions: number[]; - clazz(): MetaMessage; + clazz(): MetaMessage; isGroup: boolean; - build(rebuild?: boolean): MetaMessage|any; + build(rebuild?: boolean): MetaMessage|any; + build(rebuild?: boolean): MetaMessage|any; encode(message: Message, buffer: Buffer, noVerify?: boolean): Buffer; calculate(message: Message): number; decode(buffer: Buffer, length?: number, expectedGroupEndId?: number): Message; From 94fa3e9080c04024524307d8d1858b274176b470 Mon Sep 17 00:00:00 2001 From: Bruno Grieder Date: Thu, 28 Jul 2016 17:26:43 +0200 Subject: [PATCH 5/8] Multiple minor fixes (#10339) * better typing of onShouldStartLoadWithRequest in WebViewPropertiesIOS * Fixes to WebViewProperties * Missing methods in Navigator * Fix of Platform.select() * added support for interfacing with native-modules * added support for interfacing with native-modules * added dev variable * Update to header notes * Examples: alternative styles declaration --- react-native/react-native-tests.tsx | 26 +++++++++- react-native/react-native.d.ts | 77 ++++++++++++++++++++++++++--- 2 files changed, 94 insertions(+), 9 deletions(-) diff --git a/react-native/react-native-tests.tsx b/react-native/react-native-tests.tsx index d33918dbd6..c9d6ec779a 100644 --- a/react-native/react-native-tests.tsx +++ b/react-native/react-native-tests.tsx @@ -78,14 +78,36 @@ var styles = StyleSheet.create( } ) +//alternative declaration of styles (inline typings) +const stylesAlt = StyleSheet.create( + { + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + } as React.ViewStyle, + welcome: { + fontSize: 20, + textAlign: 'center', + margin: 10, + } as React.TextStyle, + instructions: { + textAlign: 'center', + color: '#333333', + marginBottom: 5, + } as React.TextStyle + } +) + class Welcome extends React.Component { - + refs: { [key: string]: any rootView: View } - + testNativeMethods() { // this.setNativeProps({}); diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index ff08bd0ff1..cc71452ae4 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -8,9 +8,9 @@ // USING: these definitions are meant to be used with the TSC compiler target set to ES6 // // USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer +// Warning: the project currently uses and older version of react-native // -// CONTRIBUTING: please open pull requests and make sure that the changes do not break RNTSExplorer (they should not) -// Do not hesitate to open a pull request against RNTSExplorer to provide an example for a case not covered by the current App +// CONTRIBUTING: please open pull requests // // CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie // @@ -1339,6 +1339,17 @@ declare namespace __React { domStorageEnabled?: boolean } + export interface WebViewIOSLoadRequestEvent { + target: number + canGoBack: boolean + lockIdentifier: number + loading: boolean + title: string + canGoForward: boolean + navigationType: 'other' | 'click' + url: string + } + export interface WebViewPropertiesIOS { /** @@ -1368,7 +1379,7 @@ declare namespace __React { * Return true or false from this method to continue loading the * request. */ - onShouldStartLoadWithRequest?: () => boolean + onShouldStartLoadWithRequest?: (event: WebViewIOSLoadRequestEvent) => boolean scrollEnabled?: boolean } @@ -1463,12 +1474,12 @@ declare namespace __React { /** * view to show if there's an error */ - renderError?: () => ViewStatic + renderError?: () => React.ReactElement /** * loading indicator to show */ - renderLoading?: () => ViewStatic + renderLoading?: () => React.ReactElement scrollEnabled?: boolean @@ -3313,6 +3324,16 @@ declare namespace __React { */ popToTop(): void; + /** + * Replace the previous scene and pop to it. + */ + replacePreviousAndPop( route: Route ): void; + + /** + * Navigate to a new scene and reset route stack. + */ + resetTo( route: Route ): void; + } namespace NavigatorStatic { @@ -3720,8 +3741,10 @@ declare namespace __React { export interface PlatformStatic { OS: PlatformOSType, - // only documented in PlatformSpecificInformation.md - select({PlatformOSType: any}): any + /** + * @see https://facebook.github.io/react-native/docs/platform-specific-code.html#content + */ + select( specifics: { ios?: T, android?: T} ): T; } export interface DeviceEventSubscriptionStatic { @@ -5721,6 +5744,27 @@ declare namespace __React { handleNavigation( action: NavigationAction ): boolean; } + // + // Interfacing with Native Modules + // https://facebook.github.io/react-native/docs/native-modules-ios.html + // + + export interface NativeEventSubscription { + /** + * Call this method to un-subscribe from a native-event + */ + remove(): void; + } + + /** + * Receive events from native-code + * @see https://facebook.github.io/react-native/docs/native-modules-ios.html#sending-events-to-javascript + */ + export interface NativeAppEventEmitterStatic { + addListener(event: string, handler: (data: any) => void): NativeEventSubscription; + } + + ////////////////////////////////////////////////////////////////////////// // // R E - E X P O R T S @@ -5923,6 +5967,16 @@ declare namespace __React { export type Easing = EasingStatic; export var Easing: EasingStatic; + //Native Modules written in ObjectiveC/Swift/Java exposed via the RCTBridge + //See https://facebook.github.io/react-native/docs/native-modules-ios.html + + /** + * Use: + * const MyModule = NativeModules.ModuleName + */ + export var NativeModules: any + export var NativeAppEventEmitter: NativeAppEventEmitterStatic + // // /TODO: BGR: These are leftovers of the initial port that must be revisited // @@ -5986,3 +6040,12 @@ declare module "react-native" { declare var global: __React.GlobalStatic declare function require( name: string ): any + +/** + * This variable is set to true when react-native is running in Dev mode + * Typical usage: + * if (__DEV__) console.log('Running in dev mode') + */ +declare var __DEV__: boolean + + From 2864d4666436b055aea2e46f53d5ee6bbabcba55 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Thu, 28 Jul 2016 11:31:34 -0400 Subject: [PATCH 6/8] webcomponents.js: Add typings for Element.createShadowRoot (#10330) * webcomponents.js: Add typings for Element.createShadowRoot createShadowRoot is deprecated in the official Shadow DOM spec, but is the way to attach a shadow root in the current released version of webcomponents.js. * webcomponents.js: remove spurious extra line * webcomponents.js: remove readonly modifier Not supported until TS2. * webcomponents.js: add Element.shadowRoot property --- webcomponents.js/webcomponents.js-tests.ts | 9 +++++++++ webcomponents.js/webcomponents.js.d.ts | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/webcomponents.js/webcomponents.js-tests.ts b/webcomponents.js/webcomponents.js-tests.ts index b5e67abb93..cb1ea0f2c4 100644 --- a/webcomponents.js/webcomponents.js-tests.ts +++ b/webcomponents.js/webcomponents.js-tests.ts @@ -36,6 +36,15 @@ window.HTMLImports.whenReady(() => { document.querySelectorAll(`link[type=${window.HTMLImports.IMPORT_LINK_TYPE}`); +/* + * Shadow DOM + */ + +var shadow = xFoo.createShadowRoot(); +xFoo.shadowRoot; +shadow.innerHTML; +shadow.host; + /* * Web Components */ diff --git a/webcomponents.js/webcomponents.js.d.ts b/webcomponents.js/webcomponents.js.d.ts index 7390cc5bc8..2f4ea424e4 100644 --- a/webcomponents.js/webcomponents.js.d.ts +++ b/webcomponents.js/webcomponents.js.d.ts @@ -31,6 +31,11 @@ declare namespace webcomponents { whenReady(callback: () => void): void; } + export interface ShadowRootPolyfill extends DocumentFragment { + innerHTML: string; + host: Element; + } + export interface Polyfill { flags: any; } @@ -41,6 +46,11 @@ declare module "webcomponents.js" { export = webcomponents; } +interface Element { + createShadowRoot(): webcomponents.ShadowRootPolyfill; + shadowRoot?: webcomponents.ShadowRootPolyfill; +} + interface Document { registerElement(name: string, prototype: webcomponents.CustomElementInit): webcomponents.CustomElementConstructor; } From 6303ed1e73be8bbc13d60d7ce700326c6774eb76 Mon Sep 17 00:00:00 2001 From: David Newell Date: Thu, 28 Jul 2016 17:32:58 -0400 Subject: [PATCH 7/8] Adding a couple missing highcharts properites (#10340) * Adding a couple missing highcharts properites * Fixing indentation * Indentation --- highcharts/highcharts-tests.ts | 1 + highcharts/highcharts.d.ts | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index 499dfc9494..d8b74de31e 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -2258,6 +2258,7 @@ function test_PointObject() { var point = $('#container').highcharts().get('point1'); var category = point.category; var percentage = point.percentage; + point.index; point.remove(); point.remove(false); point.remove(false, {duration: 50}); diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index 45f69a0bda..a338f19757 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Highcharts 4.1.9 +// Type definitions for Highcharts 4.2.5 // Project: http://www.highcharts.com/ // Definitions by: Damiano Gambarotto , Dan Lewi Harkestad // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -4817,6 +4817,17 @@ interface HighchartsPlotOptions { */ interface HighchartsIndividualSeriesOptions { type?: string; + /** + * The main color or the series. In line type series it applies to the line and the point markers unless otherwise + * specified. In bar type series it applies to the bars unless a color is specified per point. The default + * value is pulled from the options.colors array. + */ + color?: string; + /** + * You can set the cursor to "pointer" if you have click events attached to the series, to signal to the user + * that the points and lines can be clicked. + */ + cursor?: string; /** * An array of data points for the series. For the area series type, points can be given in the following ways: * @@ -4867,6 +4878,11 @@ interface HighchartsIndividualSeriesOptions { * The name of the series as shown in the legend, tooltip etc. */ name?: string; + /** + * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from + * the pointPadding and groupPadding. + */ + pointWidth?: number; /** * This option allows grouping series in a stacked chart. The stack option can be a string or a number or anything * else, as long as the grouped series' stack options match each other. @@ -5472,12 +5488,12 @@ interface HighchartsOptions { * The X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the * vertical axis. In case of multiple axes, the xAxis node is an array of configuration objects. */ - xAxis?: HighchartsAxisOptions | HighchartsAxisOptions[]; + xAxis?: HighchartsAxisOptions[] | HighchartsAxisOptions; /** * The Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the * horizontal axis. In case of multiple axes, the yAxis node is an array of configuration objects. */ - yAxis?: HighchartsAxisOptions | HighchartsAxisOptions[]; + yAxis?: HighchartsAxisOptions[] | HighchartsAxisOptions; } interface HighchartsGlobalOptions extends HighchartsOptions { @@ -6098,6 +6114,7 @@ interface HighchartsPointObject { */ category: string | number; name: string; + index: number; /** * The percentage for points in a stacked series or pies. * @since 1.2.0 From 094dfc6420d3118c9c691764a29b4fbbfc041af6 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Fri, 29 Jul 2016 04:59:34 +0200 Subject: [PATCH 8/8] Update to Electron 1.3.1 (#10336) * Update to Electron 1.3.1 * Update editing command docs * Fix argument types --- github-electron/github-electron-main-tests.ts | 1 - github-electron/github-electron.d.ts | 59 +++++++++++++------ 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 0b928138e4..c8d0c8df7c 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -284,7 +284,6 @@ app.on('ready', () => { app.commandLine.appendSwitch('remote-debugging-port', '8315'); app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); -app.commandLine.appendSwitch('v', -1); app.commandLine.appendSwitch('vmodule', 'console=0'); // systemPreferences diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 0cd51c1601..ce01bb23d5 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron v1.2.8 +// Type definitions for Electron v1.3.1 // Project: http://electron.atom.io/ // Definitions by: jedmao , rhysd , Milan Burda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -401,7 +401,7 @@ declare namespace Electron { * Note: This will not affect process.argv, and is mainly used by developers * to control some low-level Chromium behaviors. */ - appendSwitch(_switch: string, value?: string|number): void; + appendSwitch(_switch: string, value?: string): void; /** * Append an argument to Chromium's command line. The argument will quoted properly. * @@ -2799,7 +2799,7 @@ declare namespace Electron { /** * Sets the proxy settings. */ - setProxy(config: string, callback: Function): void; + setProxy(config: ProxyConfig, callback: Function): void; /** * Resolves the proxy information for url. */ @@ -2882,6 +2882,21 @@ declare namespace Electron { quotas?: ('temporary' | 'persistent' | 'syncable')[]; } + interface ProxyConfig { + /** + * The URL associated with the PAC file. + */ + pacScript: string; + /** + * Rules indicating which proxies to use. + */ + proxyRules: string; + /** + * Rules indicating which URLs should bypass the proxy settings. + */ + proxyBypassRules: string; + } + interface NetworkEmulationOptions { /** * Whether to emulate network outage. @@ -3386,10 +3401,10 @@ declare namespace Electron { */ setTitle(title: string): void; /** - * Sets whether the tray icon is highlighted when it is clicked. + * Sets when the tray's icon background becomes highlighted. * Note: This is only implemented on macOS. */ - setHighlightMode(highlight: boolean): void; + setHighlightMode(mode: 'selection' | 'always' | 'never'): void; /** * Displays a tray balloon. * Note: This is only implemented on Windows. @@ -3641,6 +3656,10 @@ declare namespace Electron { * passing empty string to callback will cancel the request. */ on(event: 'select-bluetooth-device', listener: (event: Event, deviceList: BluetoothDevice[], callback: (deviceId: string) => void) => void): this; + /** + * Emitted when a page's view is repainted. + */ + on(event: 'view-painted', listener: Function): this; on(event: string, listener: Function): this; /** * Loads the url in the window. @@ -3751,47 +3770,51 @@ declare namespace Electron { */ isAudioMuted(): boolean; /** - * Executes Edit -> Undo command in page. + * Executes the editing command undo in web page. */ undo(): void; /** - * Executes Edit -> Redo command in page. + * Executes the editing command redo in web page. */ redo(): void; /** - * Executes Edit -> Cut command in page. + * Executes the editing command cut in web page. */ cut(): void; /** - * Executes Edit -> Copy command in page. + * Executes the editing command copy in web page. */ copy(): void; /** - * Executes Edit -> Paste command in page. + * Copy the image at the given position to the clipboard. + */ + copyImageAt(x: number, y: number): void; + /** + * Executes the editing command paste in web page. */ paste(): void; /** - * Executes Edit -> Paste and Match Style in page. + * Executes the editing command pasteAndMatchStyle in web page. */ pasteAndMatchStyle(): void; /** - * Executes Edit -> Delete command in page. + * Executes the editing command delete in web page. */ delete(): void; /** - * Executes Edit -> Select All command in page. + * Executes the editing command selectAll in web page. */ selectAll(): void; /** - * Executes Edit -> Unselect command in page. + * Executes the editing command unselect in web page. */ unselect(): void; /** - * Executes Edit -> Replace command in page. + * Executes the editing command replace in web page. */ replace(text: string): void; /** - * Executes Edit -> Replace Misspelling command in page. + * Executes the editing command replaceMisspelling in web page. */ replaceMisspelling(text: string): void; /** @@ -4342,7 +4365,7 @@ declare namespace Electron { wheelTicksY?: number; accelerationRatioX?: number; accelerationRatioY?: number; - hasPreciseScrollingDeltas?: number; + hasPreciseScrollingDeltas?: boolean; canScroll?: boolean; } @@ -4619,7 +4642,7 @@ declare namespace Electron { /** * Navigates to the specified offset from the "current entry". */ - goToOffset(offset: boolean): void; + goToOffset(offset: number): void; /** * @returns Whether the renderer process has crashed. */