diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index 7f26465b14..3712e20cf7 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -2,106 +2,104 @@ // Project: https://github.com/vimeo/player.js // Definitions by: Denis Yılmaz , Felix Albert // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// tslint:disable-next-line no-single-declare-module -declare module "@vimeo/player" { - function myMethod(a: string): string; - function myOtherMethod(a: number): number; - type CallbackFunction = (...args: any[]) => any; +export function myMethod(a: string): string; +export function myOtherMethod(a: number): number; - interface Error {name: string; message: string; method: string; } +export type CallbackFunction = (...args: any[]) => any; - interface PasswordError extends Error {name: "PasswordError"; message: string; method: string; } - interface PrivacyError extends Error {name: "PrivacyError"; message: string; method: string; } - interface InvalidTrackLanguageError extends Error {name: "InvalidTrackLanguageError"; message: string; method: string; } - interface InvalidTrackError extends Error {name: "InvalidTrackError"; message: string; method: string; } - interface UnsupportedError extends Error {name: "UnsupportedError"; message: string; method: string; } - interface ContrastError extends Error {name: "ContrastError"; message: string; method: string; } - interface InvalidCuePoint extends Error {name: "InvalidCuePoint"; message: string; method: string; } - interface RangeError extends Error {name: "RangeError"; message: string; method: string; } - interface TypeError extends Error {name: "TypeError"; message: string; method: string; } +export interface Error {name: string; message: string; method: string; } - type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | "seeked" | "texttrackchange" | "cuechange" | "cuepoint" | "volumechange" | "error" | "loaded" | string; - type EventCallback = (data: any) => any; +export interface PasswordError extends Error {name: "PasswordError"; message: string; method: string; } +export interface PrivacyError extends Error {name: "PrivacyError"; message: string; method: string; } +export interface InvalidTrackLanguageError extends Error {name: "InvalidTrackLanguageError"; message: string; method: string; } +export interface InvalidTrackError extends Error {name: "InvalidTrackError"; message: string; method: string; } +export interface UnsupportedError extends Error {name: "UnsupportedError"; message: string; method: string; } +export interface ContrastError extends Error {name: "ContrastError"; message: string; method: string; } +export interface InvalidCuePoint extends Error {name: "InvalidCuePoint"; message: string; method: string; } +export interface RangeError extends Error {name: "RangeError"; message: string; method: string; } +export interface TypeError extends Error {name: "TypeError"; message: string; method: string; } - class Player { - constructor(element: HTMLIFrameElement|HTMLElement|string, options: Options); +export type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | "seeked" | "texttrackchange" | "cuechange" | "cuepoint" | "volumechange" | "error" | "loaded" | string; +export type EventCallback = (data: any) => any; - on(event: EventName, callback: EventCallback): void; - off(event: EventName, callback?: EventCallback): void; - loadVideo(id: number): VimeoPromise; - ready(): VimeoPromise; - enableTextTrack(language: string, kind?: string): VimeoPromise; - disableTextTrack(): VimeoPromise; - pause(): VimeoPromise; - play(): VimeoPromise; - unload(): VimeoPromise; - getAutopause(): VimeoPromise; - setAutopause(autopause: boolean): VimeoPromise; - getColor(): VimeoPromise; - setColor(color: string): VimeoPromise; - addCuePoint(time: number, data: VimeoCuePointData): VimeoPromise; - removeCuePoint(id: string): VimeoPromise; - getCuePoints(): VimeoPromise; - getCurrentTime(): VimeoPromise; - setCurrentTime(seconds: number): VimeoPromise; - getDuration(): VimeoPromise; - getEnded(): VimeoPromise; - getLoop(): VimeoPromise; - setLoop(loop: boolean): VimeoPromise; - getPaused(): VimeoPromise; - getTextTracks(): VimeoPromise; - getVideoEmbedCode(): VimeoPromise; - getVideoId(): VimeoPromise; - getVideoTitle(): VimeoPromise; - getVideoWidth(): VimeoPromise; - getVideoHeight(): VimeoPromise; - getVideoUrl(): VimeoPromise; - getVolume(): VimeoPromise; - setVolume(volume: number): VimeoPromise; - } +export class Player { + constructor(element: HTMLIFrameElement|HTMLElement|string, options: Options); - interface VimeoCuePoint { - time: number; - data: VimeoCuePointData; - id: string; - } - - interface VimeoCuePointData extends Object { - customKey: string; - } - - interface VimeoTextTrack { - language: string; - kind: string; - label: string; - mode?: string; - } - - interface Options { - id?: number; - url?: string; - autopause?: boolean; - autoplay?: boolean; - byline?: boolean; - color?: string; - height?: number; - loop?: boolean; - maxheight?: number; - maxwidth?: number; - portrait?: boolean; - title?: boolean; - width?: number; - } - - interface VimeoPromise extends Promise { - ( - successCallback?: (promiseValue: Result) => void, - rejectCallback?: (reasonValue: Reason) => void - ): Promise; - } - - /*~ You can declare properties of the module using const, let, or var */ - const playerMap: WeakMap; - const readyMap: WeakMap; + on(event: EventName, callback: EventCallback): void; + off(event: EventName, callback?: EventCallback): void; + loadVideo(id: number): VimeoPromise; + ready(): VimeoPromise; + enableTextTrack(language: string, kind?: string): VimeoPromise; + disableTextTrack(): VimeoPromise; + pause(): VimeoPromise; + play(): VimeoPromise; + unload(): VimeoPromise; + getAutopause(): VimeoPromise; + setAutopause(autopause: boolean): VimeoPromise; + getColor(): VimeoPromise; + setColor(color: string): VimeoPromise; + addCuePoint(time: number, data: VimeoCuePointData): VimeoPromise; + removeCuePoint(id: string): VimeoPromise; + getCuePoints(): VimeoPromise; + getCurrentTime(): VimeoPromise; + setCurrentTime(seconds: number): VimeoPromise; + getDuration(): VimeoPromise; + getEnded(): VimeoPromise; + getLoop(): VimeoPromise; + setLoop(loop: boolean): VimeoPromise; + getPaused(): VimeoPromise; + getTextTracks(): VimeoPromise; + getVideoEmbedCode(): VimeoPromise; + getVideoId(): VimeoPromise; + getVideoTitle(): VimeoPromise; + getVideoWidth(): VimeoPromise; + getVideoHeight(): VimeoPromise; + getVideoUrl(): VimeoPromise; + getVolume(): VimeoPromise; + setVolume(volume: number): VimeoPromise; } + +export interface VimeoCuePoint { + time: number; + data: VimeoCuePointData; + id: string; +} + +export interface VimeoCuePointData extends Object { + customKey: string; +} + +export interface VimeoTextTrack { + language: string; + kind: string; + label: string; + mode?: string; +} + +export interface Options { + id?: number; + url?: string; + autopause?: boolean; + autoplay?: boolean; + byline?: boolean; + color?: string; + height?: number; + loop?: boolean; + maxheight?: number; + maxwidth?: number; + portrait?: boolean; + title?: boolean; + width?: number; +} + +export interface VimeoPromise extends Promise { + ( + successCallback?: (promiseValue: Result) => void, + rejectCallback?: (reasonValue: Reason) => void + ): Promise; +} + +/*~ You can declare properties of the module using const, let, or var */ +export const playerMap: WeakMap; +export const readyMap: WeakMap; diff --git a/types/vimeo__player/tsconfig.json b/types/vimeo__player/tsconfig.json index 515a54d8e8..80168bdbdc 100644 --- a/types/vimeo__player/tsconfig.json +++ b/types/vimeo__player/tsconfig.json @@ -8,11 +8,14 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "baseUrl": "types", + "baseUrl": "../", "typeRoots": [ "types" ], "types": [], + "paths": { + "@vimeo/player": ["vimeo__player"] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/xmpp__jid/index.d.ts b/types/xmpp__jid/index.d.ts index 0e785a5bd3..f3f5bcc485 100644 --- a/types/xmpp__jid/index.d.ts +++ b/types/xmpp__jid/index.d.ts @@ -2,61 +2,54 @@ // Project: https://github.com/node-xmpp/node-xmpp/ // Definitions by: PJakcson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// TODO: Once TS2.3 is released, -// https://github.com/Microsoft/TypeScript/issues/14819 should be fixed. -// Then, upgrade this package's typescript version to 2.3 and -// Remove the `declare module` wrapper. -// tslint:disable-next-line no-single-declare-module -declare module "@xmpp/jid" { - function createJID(local: string, domain: string, resource: string): JID; - function equal(a: JID, b: JID): boolean; - function is(a: any): boolean; +export function createJID(local: string, domain: string, resource: string): JID; +export function equal(a: JID, b: JID): boolean; +export function is(a: any): boolean; + +/** + * Created by marcneumann on 17.02.17. + */ +export class JID { + local: string; + domain: string; + resource: string; + + constructor(local: string, domain?: string, resource?: string); + + parseJID(jid: string): void; + + toString(unescape?: any): string; /** - * Created by marcneumann on 17.02.17. + * Convenience method to distinguish users */ - class JID { - local: string; - domain: string; - resource: string; + bare(): JID; - constructor(local: string, domain?: string, resource?: string); + /** + * Comparison function + */ + equals(other: JID): boolean; - parseJID(jid: string): void; + /** + * http://xmpp.org/rfcs/rfc6122.html#addressing-localpart + */ + setLocal(local: string, escape?: any): void; - toString(unescape?: any): string; + getLocal(unescape?: any): string; - /** - * Convenience method to distinguish users - */ - bare(): JID; + /** + * http://xmpp.org/rfcs/rfc6122.html#addressing-domain + */ + setDomain(value: string): void; - /** - * Comparison function - */ - equals(other: JID): boolean; + getDomain(): string; - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-localpart - */ - setLocal(local: string, escape?: any): void; + /** + * http://xmpp.org/rfcs/rfc6122.html#addressing-resourcepart + */ + setResource(value: string): void; - getLocal(unescape?: any): string; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-domain - */ - setDomain(value: string): void; - - getDomain(): string; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-resourcepart - */ - setResource(value: string): void; - - getResource(): string; - } + getResource(): string; } diff --git a/types/xmpp__jid/tsconfig.json b/types/xmpp__jid/tsconfig.json index b9262f6dfb..526a2a50c0 100644 --- a/types/xmpp__jid/tsconfig.json +++ b/types/xmpp__jid/tsconfig.json @@ -12,6 +12,9 @@ "../" ], "types": [], + "paths": { + "@xmpp/jid": ["xmpp__jid"] + }, "noEmit": true, "forceConsistentCasingInFileNames": true },