Archive commit

This commit is contained in:
Erik McClure
2019-08-28 21:15:02 -07:00
commit 735845746e
1435 changed files with 140724 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
/// <reference path="my/fix.d.ts" />
/// <reference path="my/canvas.d.ts" />
/// <reference path="my/node-async.d.ts" />
/// <reference path="my/patreon.d.ts" />
+22
View File
@@ -0,0 +1,22 @@
interface HTMLCanvasElement {
toBuffer(callback: (err: any, buffer: Buffer) => void): void;
toBuffer(): Buffer;
}
interface NodeCanvasImage extends HTMLImageElement {
src: any;
}
interface NodeCanvas extends HTMLCanvasElement {
new(width?: number, height?: number): NodeCanvas;
}
interface NodeStaticImage {
new(width?: number, height?: number): NodeCanvasImage;
}
declare module "canvas" {
export function createCanvas(width: number, height: number): HTMLCanvasElement;
export type Canvas = HTMLCanvasElement;
export const Image: NodeStaticImage;
}
+66
View File
@@ -0,0 +1,66 @@
interface HTMLCanvasElement {
getContext(contextId: "webgl2", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
}
interface WebGLRenderingContext {
readonly MAX_ELEMENT_INDEX: number;
}
interface Window {
readonly Notification: any;
}
interface NodeModule {
hot?: { accept(): void; };
}
interface Promise<T> {
finally(handler: () => any): Promise<T>;
}
declare const requestIdleCallback: (callback: () => void) => number;
declare const cancelIdleCallback: (idle: number) => void;
declare const Zone: any;
declare const DEVELOPMENT: boolean;
declare const TOOLS: boolean;
declare const SERVER: boolean;
declare const BETA: boolean;
declare const TIMING: boolean;
declare const TESTS: boolean;
declare module '*.json';
declare module 'connect-mongo';
declare module 'passport-google-oauth20' { export const Strategy: any; }
declare module 'passport-twitter' { export const Strategy: any; }
declare module 'passport-facebook' { export const Strategy: any; }
declare module '@passport-next/passport-google-oauth2' { export const Strategy: any; }
declare module '@passport-next/passport-facebook' { export const Strategy: any; }
declare module 'passport-github2' { export const Strategy: any; }
declare module 'passport-vkontakte' { export const Strategy: any; }
declare module 'passport-yahoo-oauth' { export const Strategy: any; }
declare module 'passport-tumblr' { export const Strategy: any; }
declare module 'passport-deviantart' { export const Strategy: any; }
declare module 'passport-steam' { export const Strategy: any; }
declare module 'passport-patreon' { export const Strategy: any; }
declare module 'timsort' {
export function sort<T>(array: T[], compare: (a: T, b: T) => number): void;
}
declare module 'color-convert' {
export const hex: {
lab(color: string): [number, number, number];
};
}
declare module 'delta-e' {
export interface LAB {
L: number;
A: number;
B: number;
}
export function getDeltaE00(a: LAB, b: LAB): number;
}
+22
View File
@@ -0,0 +1,22 @@
declare module "fs" {
import * as Promise from "bluebird";
export function writeFileAsync(filename: string, data: any): Promise<void>;
export function writeFileAsync(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; } | string): Promise<void>;
export function writeFileAsync(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; } | string): Promise<void>;
export function appendFileAsync(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; } | string): Promise<void>;
export function appendFileAsync(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; } | string): Promise<void>;
export function appendFileAsync(filename: string, data: any): Promise<void>;
export function readFileAsync(filename: string, encoding: string): Promise<string>;
export function readFileAsync(filename: string, options: { encoding: string; flag?: string; }): Promise<string>;
export function readFileAsync(filename: string, options: { flag?: string; }): Promise<Buffer>;
export function readFileAsync(filename: string): Promise<Buffer>;
export function readdirAsync(path: string): Promise<string[]>;
export function unlinkAsync(path: string): Promise<void>;
export function mkdirAsync(path: string): Promise<void>;
export function mkdirAsync(path: string, mode: number): Promise<void>;
export function mkdirAsync(path: string, mode: string): Promise<void>;
export function renameAsync(oldPath: string, newPath: string): Promise<void>;
export function statAsync(path: string): Promise<Stats>;
export function rmdirAsync(path: string): Promise<void>;
}
+62
View File
@@ -0,0 +1,62 @@
declare module 'patreon' {
export interface PatronDataRelation {
data: {
id: string;
type: string;
};
links: {
related: string;
};
}
export interface PatronDataEntry {
attributes: {
title?: string;
description?: string;
amount_cents?: number;
created_at?: string;
declined_since?: string | null;
patron_pays_fees?: boolean;
pledge_cap_cents?: number;
total_historical_amount_cents?: number;
};
id: string;
relationships: {
patron: PatronDataRelation;
reward: PatronDataRelation;
};
type: string;
}
export interface PatronData {
rawJson: {
data: PatronDataEntry[];
included: PatronDataEntry[];
links: {
next?: string;
};
};
}
export interface PatreonClient {
(pathname: string): Promise<PatronData>;
getStore(): any;
setStore(store: { sync: () => void }): void;
}
export interface PatreonTokens {
access_token: string;
refresh_token: string;
expires_in: string;
scope: string;
token_type: string;
}
export interface PatreonOAuthClient {
getTokens(redirectCode: string, redirectUri: string): Promise<PatreonTokens>;
refreshToken(refreshToken: string): Promise<any>;
}
export function patreon(accessToken: string): PatreonClient;
export function oauth(clientId: string, clientSecret: string): PatreonOAuthClient;
}