mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
54
chrome/chrome-app.d.ts
vendored
54
chrome/chrome-app.d.ts
vendored
@@ -1,8 +1,9 @@
|
||||
// Type definitions for Chrome packaged application development
|
||||
// Type definitions for Chrome packaged application development
|
||||
// Project: http://developer.chrome.com/apps/
|
||||
// Definitions by: Adam Lay <https://github.com/AdamLay>, MIZUNE Pine <https://github.com/pine613>, MIZUSHIMA Junki <https://github.com/mzsm>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="chrome.d.ts"/>
|
||||
/// <reference path='../filesystem/filesystem.d.ts'/>
|
||||
|
||||
////////////////////
|
||||
@@ -22,13 +23,9 @@ declare module chrome.app.runtime {
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface LaunchedEvent {
|
||||
addListener(callback: (launchData: LaunchData) => void): void;
|
||||
}
|
||||
interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> {}
|
||||
|
||||
interface RestartedEvent {
|
||||
addListener(callback: () => void): void;
|
||||
}
|
||||
interface RestartedEvent extends chrome.events.Event<() => void> {}
|
||||
|
||||
var onLaunched: LaunchedEvent;
|
||||
var onRestarted: RestartedEvent;
|
||||
@@ -136,10 +133,7 @@ declare module chrome.app.window {
|
||||
export function getAll(): AppWindow[];
|
||||
export function canSetVisibleOnAllWorkspaces(): boolean;
|
||||
|
||||
interface WindowEvent {
|
||||
addListener(callback: () => void): void;
|
||||
removeListener(callback: () => void): void;
|
||||
}
|
||||
interface WindowEvent extends chrome.events.Event<() => void> {}
|
||||
|
||||
var onBoundsChanged: WindowEvent;
|
||||
var onClosed: WindowEvent;
|
||||
@@ -154,20 +148,6 @@ declare module chrome.app.window {
|
||||
////////////////////
|
||||
declare module chrome.fileSystem {
|
||||
|
||||
interface ChildChangeInfo {
|
||||
entry: Entry;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface EntryChangedEvent {
|
||||
target: Entry;
|
||||
childChanges?: ChildChangeInfo[];
|
||||
}
|
||||
|
||||
interface EntryRemovedEvent {
|
||||
target: Entry;
|
||||
}
|
||||
|
||||
interface AcceptOptions {
|
||||
description?: string;
|
||||
mimeTypes?: string[];
|
||||
@@ -207,10 +187,6 @@ declare module chrome.sockets.tcp {
|
||||
bytesSent?: number;
|
||||
}
|
||||
|
||||
interface Event<T> {
|
||||
addListener(callback: (info: T) => void): void;
|
||||
}
|
||||
|
||||
interface ReceiveEventArgs {
|
||||
socketId: number;
|
||||
data: ArrayBuffer;
|
||||
@@ -260,8 +236,8 @@ declare module chrome.sockets.tcp {
|
||||
export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void;
|
||||
export function getSockets(socketId: number, callback: (socketInfos: SocketInfo[]) => void): void;
|
||||
|
||||
var onReceive: Event<ReceiveEventArgs>;
|
||||
var onReceiveError: Event<ReceiveErrorEventArgs>;
|
||||
var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>;
|
||||
var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>;
|
||||
}
|
||||
|
||||
declare module chrome.sockets.udp {
|
||||
@@ -274,10 +250,6 @@ declare module chrome.sockets.udp {
|
||||
bytesSent?: number;
|
||||
}
|
||||
|
||||
interface Event<T> {
|
||||
addListener(callback: (info: T) => void): void;
|
||||
}
|
||||
|
||||
interface ReceiveEventArgs {
|
||||
socketId: number;
|
||||
data: ArrayBuffer;
|
||||
@@ -323,8 +295,8 @@ declare module chrome.sockets.udp {
|
||||
export function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void;
|
||||
export function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void;
|
||||
|
||||
var onReceive: Event<ReceiveEventArgs>;
|
||||
var onReceiveError: Event<ReceiveErrorEventArgs>;
|
||||
var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>;
|
||||
var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>;
|
||||
}
|
||||
|
||||
declare module chrome.sockets.tcpServer {
|
||||
@@ -332,10 +304,6 @@ declare module chrome.sockets.tcpServer {
|
||||
socketId: number;
|
||||
}
|
||||
|
||||
interface Event<T> {
|
||||
addListener(callback: (info: T) => void): void;
|
||||
}
|
||||
|
||||
interface AcceptEventArgs {
|
||||
socketId: number;
|
||||
clientSocketId: number;
|
||||
@@ -375,8 +343,8 @@ declare module chrome.sockets.tcpServer {
|
||||
export function close(socketId: number, callback?: () => void): void;
|
||||
export function getInfo(socketId: number, callback: (socketInfos: SocketInfo[]) => void): void;
|
||||
|
||||
var onAccept: Event<AcceptEventArgs>;
|
||||
var onAcceptError: Event<AcceptErrorEventArgs>;
|
||||
var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>;
|
||||
var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
Reference in New Issue
Block a user