mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Merge pull request #10405 from RyanCavanaugh/types-2.0
Definition fixes for 2.0
This commit is contained in:
@@ -8,7 +8,7 @@ const t1: number = composeFunction(numberToNumber, numberToNumber)(5);
|
||||
const t2: string = composeFunction(numberToString, numberToNumber)(5);
|
||||
const t3: string = composeFunction(numberToString, stringToNumber)("f");
|
||||
const t4: (a: string) => number = composeFunction(
|
||||
(f: (a: string) => number) => ((p: string) => 5),
|
||||
(f: (a: string) => number) => ((p: string): number => 5),
|
||||
(f: (a: number) => string) => ((p: string) => 4)
|
||||
)(numberToString);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/// <reference types="cordova" />
|
||||
|
||||
|
||||
cordova.getAppVersion.getAppName()
|
||||
.then(appName=> {
|
||||
console.log(appName)
|
||||
|
||||
+5
-5
@@ -8,9 +8,9 @@
|
||||
|
||||
interface Cordova {
|
||||
getAppVersion: {
|
||||
getAppName: () => Q.IPromise<string> | JQueryPromise<string>;
|
||||
getPackageName: () => Q.IPromise<string> | JQueryPromise<string>;
|
||||
getVersionCode: () => Q.IPromise<string> | JQueryPromise<string>;
|
||||
getVersionNumber: () => Q.IPromise<string> | JQueryPromise<string>;
|
||||
getAppName: () => Q.IPromise<string> & JQueryPromise<string>;
|
||||
getPackageName: () => Q.IPromise<string> & JQueryPromise<string>;
|
||||
getVersionCode: () => Q.IPromise<string> & JQueryPromise<string>;
|
||||
getVersionNumber: () => Q.IPromise<string> & JQueryPromise<string>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ 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('v', '-1');
|
||||
app.commandLine.appendSwitch('vmodule', 'console=0');
|
||||
|
||||
// systemPreferences
|
||||
|
||||
Vendored
+2
-1
@@ -2,7 +2,8 @@
|
||||
// Project: https://github.com/wheresrhys/fetch-mock
|
||||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>, Tamir Duberstein <https://github.com/tamird>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference path="../whatwg-fetch/whatwg-fetch.d.ts" />
|
||||
|
||||
/// <reference types="whatwg-fetch" />
|
||||
|
||||
declare module "fetch-mock" {
|
||||
type MockRequest = Request | RequestInit;
|
||||
|
||||
@@ -1849,11 +1849,6 @@ function test_SolidGauge() {
|
||||
enabled: false
|
||||
},
|
||||
yAxis: {
|
||||
stops: [
|
||||
[0.1, '#55BF3B'], // green
|
||||
[0.5, '#DDDF0D'], // yellow
|
||||
[0.9, '#DF5353'] // red
|
||||
],
|
||||
lineWidth: 0,
|
||||
minorTickInterval: null,
|
||||
tickPixelInterval: 400,
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace EnumTypeAction {
|
||||
const t2: string = R.compose(numberToString, numberToNumber)(5);
|
||||
const t3: string = R.compose(numberToString, stringToNumber)("f");
|
||||
const t4: (a: string) => number = R.compose(
|
||||
(f: (a: string) => number) => ((p: string) => 5),
|
||||
(f: (a: string) => number) => ((p: string): number => 5),
|
||||
(f: (a: number) => string) => ((p: string) => 4)
|
||||
)(numberToString);
|
||||
|
||||
|
||||
Vendored
-6
@@ -7,7 +7,6 @@ export = sanitize;
|
||||
|
||||
declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
|
||||
|
||||
|
||||
declare namespace sanitize {
|
||||
type Attributes = { [attr: string]: string };
|
||||
|
||||
@@ -52,8 +51,3 @@ declare namespace sanitize {
|
||||
|
||||
function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
|
||||
}
|
||||
|
||||
|
||||
declare module 'sanitize-html' {
|
||||
export = sanitize;
|
||||
}
|
||||
|
||||
@@ -333,19 +333,19 @@ describe('assert', function () {
|
||||
|
||||
it('should throw a default message', function () {
|
||||
throwsWithMessage(function () {
|
||||
assert(1 === 2);
|
||||
assert(1 === 2 + 1);
|
||||
}, 'assert failed');
|
||||
});
|
||||
|
||||
it('should throw the specified message', function () {
|
||||
throwsWithMessage(function () {
|
||||
assert(1 === 2, 'my message');
|
||||
assert(1 === 2 + 1, 'my message');
|
||||
}, 'my message');
|
||||
});
|
||||
|
||||
it('should format the specified message', function () {
|
||||
throwsWithMessage(function () {
|
||||
assert(1 === 2, '%s !== %s', 1, 2);
|
||||
assert(1 === 2 + 1, '%s !== %s', 1, 2);
|
||||
}, '1 !== 2');
|
||||
});
|
||||
|
||||
@@ -359,7 +359,7 @@ describe('assert', function () {
|
||||
}
|
||||
};
|
||||
doesNotThrow(function () {
|
||||
assert(1 === 2, 'report error');
|
||||
assert(1 === 2 + 1, 'report error');
|
||||
});
|
||||
t.fail = fail;
|
||||
});
|
||||
|
||||
@@ -303,7 +303,7 @@ function UtilsStaticTests() {
|
||||
var t2 = valerie.utils.asArray([1,2]);
|
||||
|
||||
var t3 = valerie.utils.asFunction(1);
|
||||
var t4 = valerie.utils.asFunction(() => { return 1; });
|
||||
var t4 = valerie.utils.asFunction((): number => { return 1; });
|
||||
|
||||
var t5 = valerie.utils.isArray([1, 2]);
|
||||
var t5 = valerie.utils.isArrayOrObject(1);
|
||||
|
||||
Vendored
+21
-21
@@ -80,7 +80,7 @@ declare namespace VoxImplant {
|
||||
TransferFailed
|
||||
}
|
||||
|
||||
namespace Events {
|
||||
namespace EventTypes {
|
||||
|
||||
/**
|
||||
* Event dispatched after login , loginWithOneTimeKey, requestOneTimeLoginKey or loginWithCode function call
|
||||
@@ -184,7 +184,7 @@ declare namespace VoxImplant {
|
||||
|
||||
}
|
||||
|
||||
namespace CallEvents {
|
||||
namespace CallEventTypes {
|
||||
|
||||
/**
|
||||
* Event dispatched after call was connected
|
||||
@@ -323,7 +323,7 @@ declare namespace VoxImplant {
|
||||
}
|
||||
}
|
||||
|
||||
namespace IMEvents {
|
||||
namespace IMEventTypes {
|
||||
|
||||
/**
|
||||
* Event dispatched when chat history received
|
||||
@@ -989,27 +989,27 @@ declare namespace VoxImplant {
|
||||
|
||||
}
|
||||
|
||||
type VoxImplantEvent = Events.AuthResult | Events.ConnectionClosed | Events.ConnectionEstablished |
|
||||
Events.ConnectionFailed | Events.IncomingCall | Events.MicAccessResult |
|
||||
Events.NetStatsReceived | Events.PlaybackFinished | Events.SDKReady | Events.SourcesInfoUpdated;
|
||||
type VoxImplantEvent = EventTypes.AuthResult | EventTypes.ConnectionClosed | EventTypes.ConnectionEstablished |
|
||||
EventTypes.ConnectionFailed | EventTypes.IncomingCall | EventTypes.MicAccessResult |
|
||||
EventTypes.NetStatsReceived | EventTypes.PlaybackFinished | EventTypes.SDKReady | EventTypes.SourcesInfoUpdated;
|
||||
|
||||
|
||||
type VoxImplantCallEvent = CallEvents.Connected | CallEvents.Disconnected | CallEvents.Failed |
|
||||
CallEvents.InfoReceived | CallEvents.MessageReceived | CallEvents.ProgressToneStart |
|
||||
CallEvents.ProgressToneStop | CallEvents.TransferComplete | CallEvents.TransferFailed;
|
||||
type VoxImplantCallEvent = CallEventTypes.Connected | CallEventTypes.Disconnected | CallEventTypes.Failed |
|
||||
CallEventTypes.InfoReceived | CallEventTypes.MessageReceived | CallEventTypes.ProgressToneStart |
|
||||
CallEventTypes.ProgressToneStop | CallEventTypes.TransferComplete | CallEventTypes.TransferFailed;
|
||||
|
||||
type VoxImplantIMEvent = IMEvents.ChatHistoryReceived | IMEvents.ChatRoomBanList |
|
||||
IMEvents.ChatRoomCreated | IMEvents.ChatRoomError | IMEvents.ChatRoomHistoryReceived |
|
||||
IMEvents.ChatRoomInfo | IMEvents.ChatRoomInvitation | IMEvents.ChatRoomInviteDeclined |
|
||||
IMEvents.ChatRoomMessageModified | IMEvents.ChatRoomMessageNotModified | IMEvents.ChatRoomMessageReceived |
|
||||
IMEvents.ChatRoomMessageRemoved | IMEvents.ChatRoomNewParticipant | IMEvents.ChatRoomOperation |
|
||||
IMEvents.ChatRoomParticipantExit | IMEvents.ChatRoomParticipants | IMEvents.ChatRoomPresenceUpdate |
|
||||
IMEvents.ChatRoomStateUpdate | IMEvents.ChatRoomSubjectChange | IMEvents.ChatRoomsDataReceived |
|
||||
IMEvents.ChatStateUpdate | IMEvents.MessageModified | IMEvents.MessageNotModified |
|
||||
IMEvents.MessageReceived | IMEvents.MessageRemoved | IMEvents.MessageStatus |
|
||||
IMEvents.PresenceUpdate | IMEvents.RosterItemChange | IMEvents.RosterPresenceUpdate |
|
||||
IMEvents.RosterReceived | IMEvents.SubscriptionRequest | IMEvents.SystemError |
|
||||
IMEvents.UCConnected | IMEvents.UCDisconnected;
|
||||
type VoxImplantIMEvent = IMEventTypes.ChatHistoryReceived | IMEventTypes.ChatRoomBanList |
|
||||
IMEventTypes.ChatRoomCreated | IMEventTypes.ChatRoomError | IMEventTypes.ChatRoomHistoryReceived |
|
||||
IMEventTypes.ChatRoomInfo | IMEventTypes.ChatRoomInvitation | IMEventTypes.ChatRoomInviteDeclined |
|
||||
IMEventTypes.ChatRoomMessageModified | IMEventTypes.ChatRoomMessageNotModified | IMEventTypes.ChatRoomMessageReceived |
|
||||
IMEventTypes.ChatRoomMessageRemoved | IMEventTypes.ChatRoomNewParticipant | IMEventTypes.ChatRoomOperation |
|
||||
IMEventTypes.ChatRoomParticipantExit | IMEventTypes.ChatRoomParticipants | IMEventTypes.ChatRoomPresenceUpdate |
|
||||
IMEventTypes.ChatRoomStateUpdate | IMEventTypes.ChatRoomSubjectChange | IMEventTypes.ChatRoomsDataReceived |
|
||||
IMEventTypes.ChatStateUpdate | IMEventTypes.MessageModified | IMEventTypes.MessageNotModified |
|
||||
IMEventTypes.MessageReceived | IMEventTypes.MessageRemoved | IMEventTypes.MessageStatus |
|
||||
IMEventTypes.PresenceUpdate | IMEventTypes.RosterItemChange | IMEventTypes.RosterPresenceUpdate |
|
||||
IMEventTypes.RosterReceived | IMEventTypes.SubscriptionRequest | IMEventTypes.SystemError |
|
||||
IMEventTypes.UCConnected | IMEventTypes.UCDisconnected;
|
||||
|
||||
/**
|
||||
* VoxImplant SDK Configuration
|
||||
|
||||
@@ -7,37 +7,37 @@ vox.init({
|
||||
micRequired: true
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.SDKReady, function(event: VoxImplant.Events.SDKReady) {
|
||||
vox.addEventListener(VoxImplant.Events.SDKReady, function(event: VoxImplant.EventTypes.SDKReady) {
|
||||
console.log("VoxImplant SDK ver. " + event.version + " initialized");
|
||||
vox.connect();
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.ConnectionEstablished, function(event: VoxImplant.Events.ConnectionEstablished) {
|
||||
vox.addEventListener(VoxImplant.Events.ConnectionEstablished, function(event: VoxImplant.EventTypes.ConnectionEstablished) {
|
||||
console.log("Connection established");
|
||||
vox.login("username", "password");
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.ConnectionClosed, function(event: VoxImplant.Events.ConnectionClosed) {
|
||||
vox.addEventListener(VoxImplant.Events.ConnectionClosed, function(event: VoxImplant.EventTypes.ConnectionClosed) {
|
||||
console.log("Connection closed");
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.ConnectionFailed, function(event: VoxImplant.Events.ConnectionFailed) {
|
||||
vox.addEventListener(VoxImplant.Events.ConnectionFailed, function(event: VoxImplant.EventTypes.ConnectionFailed) {
|
||||
console.log("Connection failed. Reason: " + event.message);
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.AuthResult, function(event: VoxImplant.Events.AuthResult) {
|
||||
vox.addEventListener(VoxImplant.Events.AuthResult, function(event: VoxImplant.EventTypes.AuthResult) {
|
||||
if (event.result === true) {
|
||||
// Authorized successfully
|
||||
console.log("Logged in as " + event.displayName);
|
||||
|
||||
call = vox.call("some_number", false);
|
||||
call.addEventListener(VoxImplant.CallEvents.Connected, function(callevent: VoxImplant.CallEvents.Connected) {
|
||||
call.addEventListener(VoxImplant.CallEvents.Connected, function(callevent: VoxImplant.CallEventTypes.Connected) {
|
||||
console.log("Call connected");
|
||||
});
|
||||
call.addEventListener(VoxImplant.CallEvents.Failed, function(callevent: VoxImplant.CallEvents.Failed) {
|
||||
call.addEventListener(VoxImplant.CallEvents.Failed, function(callevent: VoxImplant.CallEventTypes.Failed) {
|
||||
console.log("Call failed, reason: " + callevent.reason);
|
||||
});
|
||||
call.addEventListener(VoxImplant.CallEvents.Disconnected, function(callevent: VoxImplant.CallEvents.Disconnected) {
|
||||
call.addEventListener(VoxImplant.CallEvents.Disconnected, function(callevent: VoxImplant.CallEventTypes.Disconnected) {
|
||||
console.log("Call disconnected");
|
||||
});
|
||||
|
||||
@@ -48,13 +48,13 @@ vox.addEventListener(VoxImplant.Events.AuthResult, function(event: VoxImplant.Ev
|
||||
}
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.MicAccessResult, function(event: VoxImplant.Events.MicAccessResult) {
|
||||
vox.addEventListener(VoxImplant.Events.MicAccessResult, function(event: VoxImplant.EventTypes.MicAccessResult) {
|
||||
console.log("Microphone access allowed: " + event.result);
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.IncomingCall, function(event: VoxImplant.Events.IncomingCall) {
|
||||
vox.addEventListener(VoxImplant.Events.IncomingCall, function(event: VoxImplant.EventTypes.IncomingCall) {
|
||||
call = event.call;
|
||||
call.addEventListener(VoxImplant.CallEvents.Connected, function(callevent: VoxImplant.CallEvents.Connected) {
|
||||
call.addEventListener(VoxImplant.CallEvents.Connected, function(callevent: VoxImplant.CallEventTypes.Connected) {
|
||||
console.log("Inbound Call Connected");
|
||||
setTimeout(function() {
|
||||
vox.disconnect();
|
||||
@@ -63,11 +63,11 @@ vox.addEventListener(VoxImplant.Events.IncomingCall, function(event: VoxImplant.
|
||||
call.answer();
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.IMEvents.MessageReceived, function(event: VoxImplant.IMEvents.MessageReceived) {
|
||||
vox.addEventListener(VoxImplant.IMEvents.MessageReceived, function(event: VoxImplant.IMEventTypes.MessageReceived) {
|
||||
console.log("Message received: " + event.content + " from " + event.id + " id " + event.message_id);
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.Events.SourcesInfoUpdated, function(event: VoxImplant.Events.SourcesInfoUpdated) {
|
||||
vox.addEventListener(VoxImplant.Events.SourcesInfoUpdated, function(event: VoxImplant.EventTypes.SourcesInfoUpdated) {
|
||||
var audioSources: VoxImplant.AudioSourceInfo[] = vox.audioSources(),
|
||||
videoSources: VoxImplant.VideoSourceInfo[] = vox.videoSources();
|
||||
console.log("Received recording sources data:");
|
||||
@@ -78,12 +78,12 @@ vox.addEventListener(VoxImplant.Events.SourcesInfoUpdated, function(event: VoxIm
|
||||
vox.useVideoSource(videoSources[0].id, function() { console.log('OK'); }, function() { console.log('Failed'); });
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.IMEvents.RosterReceived, function(event: VoxImplant.IMEvents.RosterReceived) {
|
||||
vox.addEventListener(VoxImplant.IMEvents.RosterReceived, function(event: VoxImplant.IMEventTypes.RosterReceived) {
|
||||
var roster: VoxImplant.RosterItem[] = event.roster;
|
||||
console.log("Roster received: " + roster);
|
||||
});
|
||||
|
||||
vox.addEventListener(VoxImplant.IMEvents.ChatRoomBanList, function(event: VoxImplant.IMEvents.ChatRoomBanList) {
|
||||
vox.addEventListener(VoxImplant.IMEvents.ChatRoomBanList, function(event: VoxImplant.IMEventTypes.ChatRoomBanList) {
|
||||
console.log("Banned participants: " + event.participants + " in room " + event.room);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
|
||||
|
||||
function test_HeadersCopiedFromHeaders() {
|
||||
function test_HeadersCopiedFromHeaders1() {
|
||||
var source = new Headers();
|
||||
source.append('Content-Type', 'application/json');
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_HeadersCopiedFromHash() {
|
||||
function test_HeadersCopiedFromHash1() {
|
||||
var source:HeadersMap = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_HeadersCopiedFromHeaders() {
|
||||
function test_HeadersCopiedFromHeaders2() {
|
||||
var source = new Headers();
|
||||
source.append('Content-Type', 'application/json');
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_HeadersCopiedFromHash() {
|
||||
function test_HeadersCopiedFromHash2() {
|
||||
var source:HeadersMap = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_HeadersCopiedFromHeaders() {
|
||||
function test_HeadersCopiedFromHeaders3() {
|
||||
var source = new Headers();
|
||||
source.append('Content-Type', 'application/json');
|
||||
return new Headers(source);
|
||||
}
|
||||
|
||||
function test_HeadersCopiedFromHash() {
|
||||
function test_HeadersCopiedFromHash3() {
|
||||
var source:HeadersMap = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
|
||||
@@ -175,7 +175,7 @@ generator.prompt({ name: 'Name', message: '', default: (answers) => 10 }, (answe
|
||||
generator.prompt({ name: 'Name', message: '', type: "list" }, (answer) => {});
|
||||
generator.prompt({ name: 'Name', message: '', validate: (input) => true }, (answer) => {});
|
||||
generator.prompt({ name: 'Name', message: '', validate: (input) => "Error" }, (answer) => {});
|
||||
generator.prompt({ name: 'Name', message: '', filter: (input) => input }, (answer) => {});
|
||||
generator.prompt({ name: 'Name', message: '', filter: (input: any) => input }, (answer) => {});
|
||||
generator.prompt({ name: 'Name', message: '', when: (answers) => true }, (answer) => {});
|
||||
generator.prompt({ name: 'Name', message: '', when: true }, (answer) => {});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user