@types/post-robot
Advanced tools
Comparing version 10.0.2 to 10.0.3
@@ -23,9 +23,9 @@ // Type definitions for post-robot 10.0 | ||
interface ServerOptionsType { | ||
handler?: HandlerType; | ||
errorHandler?: ErrorHandlerType; | ||
window?: CrossDomainWindowType; | ||
name?: string; | ||
domain?: DomainMatcher; | ||
once?: boolean; | ||
errorOnClose?: boolean; | ||
handler?: HandlerType | undefined; | ||
errorHandler?: ErrorHandlerType | undefined; | ||
window?: CrossDomainWindowType | undefined; | ||
name?: string | undefined; | ||
domain?: DomainMatcher | undefined; | ||
once?: boolean | undefined; | ||
errorOnClose?: boolean | undefined; | ||
} | ||
@@ -47,5 +47,5 @@ | ||
interface RegularRequestOptionsType { | ||
domain?: DomainMatcher; | ||
fireAndForget?: false; | ||
timeout?: number; | ||
domain?: DomainMatcher | undefined; | ||
fireAndForget?: false | undefined; | ||
timeout?: number | undefined; | ||
} | ||
@@ -60,5 +60,5 @@ | ||
interface FireAndForgetRequestOptionsType { | ||
domain?: DomainMatcher; | ||
fireAndForget?: true; | ||
timeout?: number; | ||
domain?: DomainMatcher | undefined; | ||
fireAndForget?: true | undefined; | ||
timeout?: number | undefined; | ||
} | ||
@@ -65,0 +65,0 @@ |
{ | ||
"name": "@types/post-robot", | ||
"version": "10.0.2", | ||
"version": "10.0.3", | ||
"description": "TypeScript definitions for post-robot", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/post-robot", | ||
"license": "MIT", | ||
@@ -27,4 +28,4 @@ "contributors": [ | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "7b9e5cb6a03636ce7788c75d7df0f061f414bc4d4752d7cac03eb171184d0af2", | ||
"typeScriptVersion": "3.5" | ||
"typesPublisherContentHash": "78e1a580a7053aa853efab5238d9f1bb76f02b0577f4cbf6f0b92da712cb1820", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -9,5 +9,78 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/post-robot. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/post-robot/index.d.ts) | ||
````ts | ||
// Type definitions for post-robot 10.0 | ||
// Project: https://github.com/krakenjs/post-robot | ||
// Definitions by: NinoScript <https://github.com/NinoScript> | ||
// Cijin <https://github.com/Cijin> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Typescript Version: 3.0 | ||
// to shut off automatic exports | ||
export {}; | ||
// Warning: This is not actually a Promise, but the interface is the same. | ||
type ZalgoPromise<T> = Promise<T>; | ||
// For the purposes of using the library on it's own Window is CrossDomain enough | ||
type CrossDomainWindowType = Window | null; | ||
type DomainMatcher = string | RegExp | string[]; | ||
type HandlerType = (event: { | ||
source: CrossDomainWindowType, | ||
origin: string, | ||
data: any | ||
}) => ZalgoPromise<any>; | ||
type ErrorHandlerType = (err: any) => void; | ||
interface ServerOptionsType { | ||
handler?: HandlerType | undefined; | ||
errorHandler?: ErrorHandlerType | undefined; | ||
window?: CrossDomainWindowType | undefined; | ||
name?: string | undefined; | ||
domain?: DomainMatcher | undefined; | ||
once?: boolean | undefined; | ||
errorOnClose?: boolean | undefined; | ||
} | ||
interface CancelableType { | ||
cancel: () => void; | ||
} | ||
// based on https://github.com/post-robot/src/public/on.js | ||
export function on(name: string, options: ServerOptionsType | HandlerType, handler?: HandlerType): CancelableType; | ||
export function once( | ||
name: string, | ||
options?: ServerOptionsType | HandlerType, | ||
handler?: HandlerType, | ||
): ZalgoPromise<{ source: any; origin: string; data: object }>; | ||
interface RegularRequestOptionsType { | ||
domain?: DomainMatcher | undefined; | ||
fireAndForget?: false | undefined; | ||
timeout?: number | undefined; | ||
} | ||
interface ResponseMessageEvent { | ||
source: CrossDomainWindowType; | ||
origin: string; | ||
data: object; | ||
} | ||
interface FireAndForgetRequestOptionsType { | ||
domain?: DomainMatcher | undefined; | ||
fireAndForget?: true | undefined; | ||
timeout?: number | undefined; | ||
} | ||
// based on https://github.com/post-robot/src/public/send.js | ||
export function send( | ||
win: CrossDomainWindowType, | ||
name: string, | ||
data?: object, | ||
options?: FireAndForgetRequestOptionsType & RegularRequestOptionsType, | ||
): ZalgoPromise<ResponseMessageEvent>; | ||
```` | ||
### Additional Details | ||
* Last updated: Wed, 26 May 2021 00:01:21 GMT | ||
* Last updated: Thu, 08 Jul 2021 20:19:44 GMT | ||
* Dependencies: none | ||
@@ -14,0 +87,0 @@ * Global values: none |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
7153
0
90