-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add typescript definitions for custom types (#486)
- Loading branch information
1 parent
5c61333
commit 0cdf665
Showing
8 changed files
with
168 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
declare module 'play-sound'; | ||
declare module 'play-sound' { | ||
export interface Options { | ||
players?: string[]; | ||
player?: string; | ||
} | ||
|
||
export interface PlayOptions { | ||
[key: string]: any; | ||
} | ||
|
||
export interface PlaySound { | ||
player: string; | ||
|
||
play: ((file: string, callback: (error: Error) => void) => PlayerProcess) & ((file: string, options: PlayOptions, callback: (error: Error) => void) => PlayerProcess); | ||
} | ||
|
||
export interface PlayerProcess { | ||
kill: () => void; | ||
} | ||
|
||
export default function (options?: Options): PlaySound; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
declare module 'puppeteer-extra-plugin-block-resources'; | ||
declare module 'puppeteer-extra-plugin-block-resources' { | ||
import {PuppeteerExtraPlugin} from 'puppeteer-extra'; | ||
|
||
export type ResourceType = | ||
'document' | | ||
'eventsource' | | ||
'fetch' | | ||
'font' | | ||
'image' | | ||
'manifest' | | ||
'media' | | ||
'other' | | ||
'script' | | ||
'stylesheet' | | ||
'texttrack' | | ||
'websocket' | | ||
'xhr'; | ||
|
||
export interface Options { | ||
availableTypes?: Set<ResourceType>; | ||
blockedTypes?: Set<ResourceType>; | ||
} | ||
|
||
export default function (options?: Options): PuppeteerExtraPlugin; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,59 @@ | ||
declare module '@hijef/pushbullet'; | ||
declare module '@hijef/pushbullet' { | ||
export type DeviceParams = string | number | Record<string, any>; | ||
|
||
export type PushBulletCallback = ((error: Error) => void) | ((error?: null, response: any) => void); | ||
|
||
export interface ListOptions { | ||
active?: boolean; | ||
cursor?: string; | ||
limit?: number; | ||
} | ||
|
||
export interface HistoryOptions extends ListOptions { | ||
modified_after?: number; | ||
} | ||
|
||
export interface PushBulletStream { | ||
connect: () => void; | ||
close: () => void; | ||
on: ((event: 'connect' | 'close' | 'nop', callback: () => void) => void) & ((event: 'error', callback: (error: any) => void) => void) & ((event: 'message', callback: (message: any) => void) => void) & ((event: 'tickle', callback: (tickle: any) => void) => void) & ((event: 'push', callback: (push: any) => void) => void); | ||
} | ||
|
||
export class PushBullet { | ||
constructor(apiKey: string, options?: {fullResponses: boolean}): this; | ||
me(callback: PushBulletCallback); | ||
devices(options: ListOptions, callback: PushBulletCallback); | ||
devices(callback: PushBulletCallback); | ||
createDevice(options: Record<string, any>, callback: PushBulletCallback); | ||
updateDevice(deviceIden: string, deviceOptions: Record<string, any>, callback: PushBulletCallback); | ||
deleteDevice(deviceIden: string, callback: PushBulletCallback); | ||
note(deviceParams: DeviceParams, title: string, body: string, callback: PushBulletCallback); | ||
link(deviceParams: DeviceParams, name: string, url: string, body: string, callback: PushBulletCallback); | ||
file(deviceParams: DeviceParams, filePath: string, message: string, callback: PushBulletCallback); | ||
dismissPush(pushIden: DeviceParams, callback: PushBulletCallback); | ||
deletePush(pushIden: DeviceParams, callback: PushBulletCallback); | ||
deleteAllPushes(callback: PushBulletCallback); | ||
history(options: HistoryOptions, callback: PushBulletCallback); | ||
history(callback: PushBulletCallback); | ||
subscriptions(options: ListOptions, callback: PushBulletCallback); | ||
subscriptions(callback: PushBulletCallback); | ||
subscribe(channelTag: string, callback: PushBulletCallback); | ||
unsubscribe(subscriptionIden: string, callback: PushBulletCallback); | ||
muteSubscription(subscriptionIden: string, callback: PushBulletCallback); | ||
unmuteSubscription(subscriptionIden: string, callback: PushBulletCallback); | ||
channelInfo(channelTag: string, callback: PushBulletCallback); | ||
chats(options: ListOptions, callback: PushBulletCallback); | ||
chats(callback: PushBulletCallback); | ||
createChat(email: string, callback: PushBulletCallback); | ||
deleteChat(chatIden: string, callback: PushBulletCallback); | ||
muteChat(chatIden: string, callback: PushBulletCallback); | ||
unmuteChat(chatIden: string, callback: PushBulletCallback); | ||
sendSMS(options: Record<string, any>, callback: PushBulletCallback); | ||
sendClipboard(options: Record<string, any>, callback: PushBulletCallback); | ||
dismissEphemeral(options: Record<string, any>, callback: PushBulletCallback); | ||
stream(): PushBulletStream; | ||
enableEncryption(encryptionPassword: string, userIden: string): PushBulletStream; | ||
} | ||
|
||
export default PushBullet; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
declare module 'pushover-notifications'; | ||
declare module 'pushover-notifications' { | ||
export type PushoverCallback = ((error: Error) => void) | ((error?: null, response: any) => void); | ||
|
||
export type Sound = | ||
'pushover' | | ||
'bike' | | ||
'bugle' | | ||
'cashregister' | | ||
'classical' | | ||
'cosmic' | | ||
'falling' | | ||
'gamelan' | | ||
'incoming' | | ||
'intermission' | | ||
'magic' | | ||
'mechanical' | | ||
'pianobar' | | ||
'siren' | | ||
'spacealarm' | | ||
'tugboat' | | ||
'alien' | | ||
'climb' | | ||
'persistent' | | ||
'echo' | | ||
'updown' | | ||
'vibrate' | | ||
'none'; | ||
|
||
export interface PushoverOptions { | ||
token: string; | ||
user: string; | ||
httpOptions?: {proxy: string}; | ||
onerror?: (error: Error | string) => void; | ||
update_sounds?: boolean; | ||
} | ||
|
||
export interface PushoverMessage { | ||
message: string; | ||
file?: string | {name: string; data: string}; | ||
device?: string; | ||
title?: string; | ||
url?: string; | ||
url_title?: string; | ||
priority?: number; | ||
sound?: Sound; | ||
timestamp?: number; | ||
} | ||
|
||
export class Pushover { | ||
constructor(options: PushoverOptions); | ||
send(message: PushoverMessage, callback: PushoverCallback); | ||
} | ||
|
||
export default Pushover; | ||
} |