mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
@@ -1509,6 +1509,7 @@ requestHandler.respond(expectedData);
|
||||
requestHandler.respond({ key: 'value' });
|
||||
requestHandler.respond({ key: 'value' }, { header: 'value' });
|
||||
requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText');
|
||||
requestHandler.respond(404);
|
||||
requestHandler.respond(404, 'data');
|
||||
requestHandler.respond(404, 'data').respond({});
|
||||
requestHandler.respond(404, { key: 'value' });
|
||||
|
||||
2
types/angular-mocks/index.d.ts
vendored
2
types/angular-mocks/index.d.ts
vendored
@@ -464,7 +464,7 @@ declare module 'angular' {
|
||||
*/
|
||||
respond(
|
||||
status: number,
|
||||
data: string | object,
|
||||
data?: string | object,
|
||||
headers?: IHttpHeaders,
|
||||
responseText?: string
|
||||
): IRequestHandler;
|
||||
|
||||
17
types/atom/index.d.ts
vendored
17
types/atom/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Atom 1.27
|
||||
// Type definitions for Atom 1.28
|
||||
// Project: https://github.com/atom/atom
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// smhxx <https://github.com/smhxx>
|
||||
@@ -7,7 +7,7 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// NOTE: only those classes exported within this file should be retain that status below.
|
||||
// https://github.com/atom/atom/blob/v1.27.0/exports/atom.js
|
||||
// https://github.com/atom/atom/blob/v1.28.0/exports/atom.js
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -5844,7 +5844,7 @@ export interface TextEditorObservedEvent {
|
||||
// information under certain contexts.
|
||||
|
||||
// NOTE: the config schema with these defaults can be found here:
|
||||
// https://github.com/atom/atom/blob/v1.27.0/src/config-schema.js
|
||||
// https://github.com/atom/atom/blob/v1.28.0/src/config-schema.js
|
||||
/**
|
||||
* Allows you to strongly type Atom configuration variables. Additional key:value
|
||||
* pairings merged into this interface will result in configuration values under
|
||||
@@ -5957,7 +5957,16 @@ export interface ConfigValues {
|
||||
* changes will miss any events caused by applications other than Atom, but may help
|
||||
* prevent crashes or freezes.
|
||||
*/
|
||||
"core.fileSystemWatcher": "native"|"atom";
|
||||
"core.fileSystemWatcher": "native"|"experimental"|"poll"|"atom";
|
||||
|
||||
/** Experimental: Use the new Tree-sitter parsing system for supported languages. */
|
||||
"core.useTreeSitterParsers": boolean;
|
||||
|
||||
/**
|
||||
* Specify whether Atom should use the operating system's color profile (recommended)
|
||||
* or an alternative color profile.
|
||||
*/
|
||||
"core.colorProfile": "default"|"srgb";
|
||||
|
||||
"editor.commentStart": string|null;
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ str = cloudwatchLogsDecodedData.logEvents[0].message;
|
||||
|
||||
/* ClientContext */
|
||||
clientContextClient = clientCtx.client;
|
||||
anyObj = clientCtx.Custom;
|
||||
anyObj = clientCtx.custom;
|
||||
clientContextEnv = clientCtx.env;
|
||||
|
||||
/* ClientContextEnv */
|
||||
|
||||
2
types/aws-lambda/index.d.ts
vendored
2
types/aws-lambda/index.d.ts
vendored
@@ -404,7 +404,7 @@ export interface CognitoIdentity {
|
||||
|
||||
export interface ClientContext {
|
||||
client: ClientContextClient;
|
||||
Custom?: any;
|
||||
custom?: any;
|
||||
env: ClientContextEnv;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,18 @@ interface MyComponentState {
|
||||
}
|
||||
|
||||
class MyComponent extends Component<MyComponentProps, MyComponentState> {
|
||||
handleEcho(value: string) {
|
||||
return value;
|
||||
}
|
||||
setState(...args: any[]) {
|
||||
console.log(args);
|
||||
}
|
||||
}
|
||||
class MyComponentPropsOnly extends Component<MyComponentProps> {
|
||||
handleEcho(value: string) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
class AnotherComponent extends Component<AnotherComponentProps> {
|
||||
setState(...args: any[]) {
|
||||
@@ -340,7 +348,16 @@ function ShallowWrapperTest() {
|
||||
}
|
||||
|
||||
function test_instance() {
|
||||
const myComponent: MyComponent = shallowWrapper.instance();
|
||||
const myComponent = shallowWrapper.instance() as MyComponent;
|
||||
myComponent.handleEcho('it works');
|
||||
|
||||
const wrapper = shallow<MyComponent>(<MyComponent stringProp="value" numberProp={1}/>);
|
||||
wrapper.instance().handleEcho('it works');
|
||||
|
||||
const wrapperPropsOnly = shallow<MyComponentProps>(<MyComponent stringProp="value" numberProp={1}/>);
|
||||
wrapperPropsOnly.setProps({stringProp: 'new value'});
|
||||
// $ExpectError
|
||||
wrapperPropsOnly.instance().handleEcho;
|
||||
}
|
||||
|
||||
function test_update() {
|
||||
@@ -696,7 +713,16 @@ function ReactWrapperTest() {
|
||||
}
|
||||
|
||||
function test_instance() {
|
||||
const myComponent: MyComponent = reactWrapper.instance();
|
||||
const myComponent = reactWrapper.instance() as MyComponent;
|
||||
myComponent.handleEcho('it works');
|
||||
|
||||
const wrapperPropsOnly = mount<MyComponentProps>(<MyComponent stringProp="value" numberProp={1}/>);
|
||||
wrapperPropsOnly.setProps({stringProp: 'new value'});
|
||||
// $ExpectError
|
||||
wrapperPropsOnly.instance().handleEcho;
|
||||
|
||||
const wrapper = mount<MyComponent>(<MyComponent stringProp="value" numberProp={1}/>);
|
||||
wrapper.instance().handleEcho('it works');
|
||||
}
|
||||
|
||||
function test_update() {
|
||||
|
||||
15
types/enzyme/index.d.ts
vendored
15
types/enzyme/index.d.ts
vendored
@@ -7,6 +7,7 @@
|
||||
// huhuanming <https://github.com/huhuanming>
|
||||
// MartynasZilinskas <https://github.com/MartynasZilinskas>
|
||||
// Torgeir Hovden <https://github.com/thovden>
|
||||
// Martin Hochel <https://github.com/hotell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -45,7 +46,7 @@ export type EnzymeSelector = string | StatelessComponent<any> | ComponentClass<a
|
||||
|
||||
export type Intercepter<T> = (intercepter: T) => void;
|
||||
|
||||
export interface CommonWrapper<P = {}, S = {}> {
|
||||
export interface CommonWrapper<P = {}, S = {}, C = Component<P, S>> {
|
||||
/**
|
||||
* Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true.
|
||||
*/
|
||||
@@ -258,7 +259,7 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
*
|
||||
* NOTE: can only be called on a wrapper instance that is also the root instance.
|
||||
*/
|
||||
instance(): Component<P, S>;
|
||||
instance(): C;
|
||||
|
||||
/**
|
||||
* Forces a re-render. Useful to run before checking the render output if something external may be updating
|
||||
@@ -354,8 +355,8 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
}
|
||||
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> { }
|
||||
export class ShallowWrapper<P = {}, S = {}> {
|
||||
export interface ShallowWrapper<P = {}, S = {}, C = Component> extends CommonWrapper<P, S, C> { }
|
||||
export class ShallowWrapper<P = {}, S = {}, C = Component> {
|
||||
constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper<any, any>, options?: ShallowRendererProps);
|
||||
shallow(options?: ShallowRendererProps): ShallowWrapper<P, S>;
|
||||
unmount(): this;
|
||||
@@ -440,8 +441,8 @@ export class ShallowWrapper<P = {}, S = {}> {
|
||||
}
|
||||
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> { }
|
||||
export class ReactWrapper<P = {}, S = {}> {
|
||||
export interface ReactWrapper<P = {}, S = {}, C = Component> extends CommonWrapper<P, S, C> { }
|
||||
export class ReactWrapper<P = {}, S = {}, C = Component> {
|
||||
constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper<any, any>, options?: MountRendererProps);
|
||||
|
||||
unmount(): this;
|
||||
@@ -588,12 +589,14 @@ export interface MountRendererProps {
|
||||
* Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that
|
||||
* your tests aren't indirectly asserting on behavior of child components.
|
||||
*/
|
||||
export function shallow<C extends Component, P = Component['props'], S = Component['state']>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, S, C>;
|
||||
export function shallow<P>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, any>;
|
||||
export function shallow<P, S>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, S>;
|
||||
|
||||
/**
|
||||
* Mounts and renders a react component into the document and provides a testing wrapper around it.
|
||||
*/
|
||||
export function mount<C extends Component, P = Component['props'], S = Component['state']>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, S, C>;
|
||||
export function mount<P>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, any>;
|
||||
export function mount<P, S>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, S>;
|
||||
|
||||
|
||||
6
types/fork-ts-checker-webpack-plugin/package.json
Normal file
6
types/fork-ts-checker-webpack-plugin/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"tslint": "*"
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ const serverRoute1: ServerRoute = {
|
||||
// Example 2
|
||||
// http://localhost:8000/person/rafael/fijalkowski
|
||||
const getPerson: Lifecycle.Method = (request, h) => {
|
||||
const nameParts = request.params.name.split('/');
|
||||
const nameParts = request.params ? request.params.name.split('/') : [];
|
||||
return { first: nameParts[0], last: nameParts[1] };
|
||||
};
|
||||
const serverRoute2: ServerRoute = {
|
||||
|
||||
158
types/node/index.d.ts
vendored
158
types/node/index.d.ts
vendored
@@ -376,20 +376,27 @@ declare var Buffer: {
|
||||
* The optional {byteOffset} and {length} arguments specify a memory range
|
||||
* within the {arrayBuffer} that will be shared by the Buffer.
|
||||
*
|
||||
* @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
|
||||
* @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
|
||||
*/
|
||||
from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
||||
// from(arrayBuffer: SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param data data to create a new Buffer
|
||||
*/
|
||||
from(data: any[] | string | ArrayBuffer | Uint8Array /*| TypedArray*/): Buffer;
|
||||
from(data: any[]): Buffer;
|
||||
from(data: Uint8Array): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer containing the given JavaScript string {str}.
|
||||
* If provided, the {encoding} parameter identifies the character encoding.
|
||||
* If not provided, {encoding} defaults to 'utf8'.
|
||||
*/
|
||||
from(str: string, encoding?: string): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param values to create a new Buffer
|
||||
*/
|
||||
of(...items: number[]): Buffer;
|
||||
/**
|
||||
* Returns true if {obj} is a Buffer
|
||||
*
|
||||
@@ -410,7 +417,7 @@ declare var Buffer: {
|
||||
* @param string string to test. (TypedArray is also allowed, but it is only available starting ES2017)
|
||||
* @param encoding encoding used to evaluate (defaults to 'utf8')
|
||||
*/
|
||||
byteLength(string: string | Buffer | DataView | ArrayBuffer, encoding?: string): number;
|
||||
byteLength(string: string | ArrayBuffer | ArrayBufferView, encoding?: string): number;
|
||||
/**
|
||||
* Returns a buffer which is the result of concatenating all the buffers in the list together.
|
||||
*
|
||||
@@ -5720,10 +5727,12 @@ declare module "tls" {
|
||||
}
|
||||
|
||||
declare module "crypto" {
|
||||
import * as stream from "stream";
|
||||
|
||||
export interface Certificate {
|
||||
exportChallenge(spkac: string | Buffer): Buffer;
|
||||
exportPublicKey(spkac: string | Buffer): Buffer;
|
||||
verifySpkac(spkac: Buffer): boolean;
|
||||
exportChallenge(spkac: string | ArrayBufferView): Buffer;
|
||||
exportPublicKey(spkac: string | ArrayBufferView): Buffer;
|
||||
verifySpkac(spkac: ArrayBufferView): boolean;
|
||||
}
|
||||
export var Certificate: {
|
||||
new(): Certificate;
|
||||
@@ -5744,8 +5753,8 @@ declare module "crypto" {
|
||||
}
|
||||
export interface Credentials { context?: any; }
|
||||
export function createCredentials(details: CredentialDetails): Credentials;
|
||||
export function createHash(algorithm: string): Hash;
|
||||
export function createHmac(algorithm: string, key: string | Buffer): Hmac;
|
||||
export function createHash(algorithm: string, options?: stream.TransformOptions): Hash;
|
||||
export function createHmac(algorithm: string, key: string | ArrayBufferView, options?: stream.TransformOptions): Hmac;
|
||||
|
||||
type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
|
||||
type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
|
||||
@@ -5754,72 +5763,112 @@ declare module "crypto" {
|
||||
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
||||
|
||||
export interface Hash extends NodeJS.ReadWriteStream {
|
||||
update(data: string | Buffer | DataView): Hash;
|
||||
update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hash;
|
||||
update(data: string | ArrayBufferView): Hash;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
export interface Hmac extends NodeJS.ReadWriteStream {
|
||||
update(data: string | Buffer | DataView): Hmac;
|
||||
update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
|
||||
update(data: string | ArrayBufferView): Hmac;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
|
||||
export type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm';
|
||||
export type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
|
||||
export interface CipherCCMOptions extends stream.TransformOptions {
|
||||
authTagLength: number;
|
||||
}
|
||||
export interface CipherGCMOptions extends stream.TransformOptions {
|
||||
authTagLength?: number;
|
||||
}
|
||||
/** @deprecated since v10.0.0 use createCipheriv() */
|
||||
export function createCipher(algorithm: string, password: any): Cipher;
|
||||
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
||||
export function createCipher(algorithm: string, password: string | ArrayBufferView, options?: stream.TransformOptions): Cipher;
|
||||
export function createCipher(algorithm: CipherCCMTypes, password: string | ArrayBufferView, options: CipherCCMOptions): CipherCCM;
|
||||
export function createCipher(algorithm: CipherGCMTypes, password: string | ArrayBufferView, options: CipherGCMOptions): CipherGCM;
|
||||
|
||||
export function createCipheriv(algorithm: string, key: string | ArrayBufferView, iv: string | ArrayBufferView, options?: stream.TransformOptions): Cipher;
|
||||
export function createCipheriv(algorithm: CipherGCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherCCMOptions): CipherCCM;
|
||||
export function createCipheriv(algorithm: CipherGCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherGCMOptions): CipherGCM;
|
||||
|
||||
export interface Cipher extends NodeJS.ReadWriteStream {
|
||||
update(data: Buffer | DataView): Buffer;
|
||||
update(data: string | ArrayBufferView): Buffer;
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
|
||||
update(data: Buffer | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
|
||||
update(data: ArrayBufferView, output_encoding: HexBase64BinaryEncoding): string;
|
||||
update(data: ArrayBufferView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
|
||||
// second arg ignored
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
|
||||
final(): Buffer;
|
||||
final(output_encoding: string): string;
|
||||
setAutoPadding(auto_padding?: boolean): this;
|
||||
// getAuthTag(): Buffer;
|
||||
// setAAD(buffer: Buffer): this; // docs only say buffer
|
||||
}
|
||||
export interface CipherCCM extends Cipher {
|
||||
setAAD(buffer: Buffer, options: { plainTextLength: number }): this;
|
||||
getAuthTag(): Buffer;
|
||||
}
|
||||
export interface CipherGCM extends Cipher {
|
||||
setAAD(buffer: Buffer, options?: { plainTextLength: number }): this;
|
||||
getAuthTag(): Buffer;
|
||||
setAAD(buffer: Buffer): this;
|
||||
}
|
||||
/** @deprecated since v10.0.0 use createCipheriv() */
|
||||
export function createDecipher(algorithm: string, password: any): Decipher;
|
||||
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
|
||||
export function createDecipher(algorithm: string, password: string | ArrayBufferView, options?: stream.TransformOptions): Decipher;
|
||||
export function createDecipher(algorithm: CipherCCMTypes, password: string | ArrayBufferView, options: CipherCCMOptions): DecipherCCM;
|
||||
export function createDecipher(algorithm: CipherGCMTypes, password: string | ArrayBufferView, options: CipherGCMOptions): DecipherGCM;
|
||||
|
||||
export function createDecipheriv(algorithm: string, key: string | ArrayBufferView, iv: string | ArrayBufferView, options?: stream.TransformOptions): Decipher;
|
||||
export function createDecipheriv(algorithm: CipherCCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherCCMOptions): DecipherCCM;
|
||||
export function createDecipheriv(algorithm: CipherGCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherGCMOptions): DecipherGCM;
|
||||
|
||||
export interface Decipher extends NodeJS.ReadWriteStream {
|
||||
update(data: Buffer | DataView): Buffer;
|
||||
update(data: ArrayBufferView): Buffer;
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
|
||||
update(data: Buffer | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
update(data: ArrayBufferView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
// second arg is ignored
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
final(): Buffer;
|
||||
final(output_encoding: string): string;
|
||||
setAutoPadding(auto_padding?: boolean): this;
|
||||
setAuthTag(tag: Buffer): this;
|
||||
setAAD(buffer: Buffer): this;
|
||||
// setAuthTag(tag: ArrayBufferView): this;
|
||||
// setAAD(buffer: ArrayBufferView): this; // docs say buffer view
|
||||
}
|
||||
export function createSign(algorithm: string): Signer;
|
||||
export interface DecipherCCM extends Decipher {
|
||||
setAuthTag(buffer: ArrayBufferView, options: { plainTextLength: number }): this;
|
||||
setAAD(buffer: ArrayBufferView): this; // docs say buffer view
|
||||
}
|
||||
export interface DecipherGCM extends Decipher {
|
||||
setAuthTag(buffer: ArrayBufferView, options?: { plainTextLength: number }): this;
|
||||
setAAD(buffer: ArrayBufferView): this; // docs say buffer view
|
||||
}
|
||||
|
||||
export function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
|
||||
export interface Signer extends NodeJS.WritableStream {
|
||||
update(data: string | Buffer | DataView): Signer;
|
||||
update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
||||
update(data: string | ArrayBufferView): Signer;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
||||
sign(private_key: string | { key: string; passphrase: string }): Buffer;
|
||||
sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
export function createVerify(algorith: string): Verify;
|
||||
export function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
|
||||
export interface Verify extends NodeJS.WritableStream {
|
||||
update(data: string | Buffer | DataView): Verify;
|
||||
update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Verify;
|
||||
verify(object: string | Object, signature: Buffer | DataView): boolean;
|
||||
update(data: string | ArrayBufferView): Verify;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
|
||||
verify(object: string | Object, signature: ArrayBufferView): boolean;
|
||||
verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
|
||||
// https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
|
||||
// The signature field accepts a TypedArray type, but it is only available starting ES2017
|
||||
}
|
||||
export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman;
|
||||
export function createDiffieHellman(prime: Buffer): DiffieHellman;
|
||||
export function createDiffieHellman(prime_length: number, generator?: number | ArrayBufferView): DiffieHellman;
|
||||
export function createDiffieHellman(prime: ArrayBufferView): DiffieHellman;
|
||||
export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman;
|
||||
export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | ArrayBufferView): DiffieHellman;
|
||||
export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
export interface DiffieHellman {
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: Buffer): Buffer;
|
||||
computeSecret(other_public_key: ArrayBufferView): Buffer;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
||||
computeSecret(other_public_key: ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
||||
getPrime(): Buffer;
|
||||
getPrime(encoding: HexBase64Latin1Encoding): string;
|
||||
@@ -5829,26 +5878,26 @@ declare module "crypto" {
|
||||
getPublicKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPrivateKey(): Buffer;
|
||||
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
||||
setPublicKey(public_key: Buffer): void;
|
||||
setPublicKey(public_key: ArrayBufferView): void;
|
||||
setPublicKey(public_key: string, encoding: string): void;
|
||||
setPrivateKey(private_key: Buffer): void;
|
||||
setPrivateKey(private_key: ArrayBufferView): void;
|
||||
setPrivateKey(private_key: string, encoding: string): void;
|
||||
verifyError: number;
|
||||
}
|
||||
export function getDiffieHellman(group_name: string): DiffieHellman;
|
||||
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void;
|
||||
export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer;
|
||||
export function pbkdf2(password: string | ArrayBufferView, salt: string | ArrayBufferView, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void;
|
||||
export function pbkdf2Sync(password: string | ArrayBufferView, salt: string | ArrayBufferView, iterations: number, keylen: number, digest: string): Buffer;
|
||||
|
||||
export function randomBytes(size: number): Buffer;
|
||||
export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
export function pseudoRandomBytes(size: number): Buffer;
|
||||
export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
export function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer;
|
||||
export function randomFill(buffer: Buffer, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
export function randomFill(buffer: Uint8Array, callback: (err: Error | null, buf: Uint8Array) => void): void;
|
||||
export function randomFill(buffer: Buffer, offset: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error | null, buf: Uint8Array) => void): void;
|
||||
export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error | null, buf: Uint8Array) => void): void;
|
||||
|
||||
export function randomFillSync(buffer: ArrayBufferView, offset?: number, size?: number): ArrayBufferView;
|
||||
export function randomFill(buffer: ArrayBufferView, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
|
||||
export function randomFill(buffer: ArrayBufferView, offset: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
|
||||
export function randomFill(buffer: ArrayBufferView, offset: number, size: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
|
||||
|
||||
export interface RsaPublicKey {
|
||||
key: string;
|
||||
padding?: number;
|
||||
@@ -5858,29 +5907,30 @@ declare module "crypto" {
|
||||
passphrase?: string;
|
||||
padding?: number;
|
||||
}
|
||||
export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer;
|
||||
export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer;
|
||||
export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer;
|
||||
export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer;
|
||||
export function publicEncrypt(public_key: string | RsaPublicKey, buffer: ArrayBufferView): Buffer;
|
||||
export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: ArrayBufferView): Buffer;
|
||||
export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: ArrayBufferView): Buffer;
|
||||
export function publicDecrypt(public_key: string | RsaPublicKey, buffer: ArrayBufferView): Buffer;
|
||||
export function getCiphers(): string[];
|
||||
export function getCurves(): string[];
|
||||
export function getHashes(): string[];
|
||||
export class ECDH {
|
||||
static convertKey(key: string | Buffer /*| TypedArray*/ | DataView, curve: string, inputEncoding?: "latin1" | "hex" | "base64", outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string;
|
||||
static convertKey(key: string | ArrayBufferView, curve: string, inputEncoding?: HexBase64Latin1Encoding, outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string;
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
||||
computeSecret(other_public_key: Buffer): Buffer;
|
||||
computeSecret(other_public_key: ArrayBufferView): Buffer;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
||||
computeSecret(other_public_key: ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
||||
getPrivateKey(): Buffer;
|
||||
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPublicKey(): Buffer;
|
||||
getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
||||
setPrivateKey(private_key: Buffer): void;
|
||||
setPrivateKey(private_key: ArrayBufferView): void;
|
||||
setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
|
||||
}
|
||||
export function createECDH(curve_name: string): ECDH;
|
||||
export function timingSafeEqual(a: Buffer, b: Buffer): boolean;
|
||||
export function timingSafeEqual(a: ArrayBufferView, b: ArrayBufferView): boolean;
|
||||
/** @deprecated since v10.0.0 */
|
||||
export var DEFAULT_ENCODING: string;
|
||||
}
|
||||
|
||||
@@ -1041,6 +1041,12 @@ namespace crypto_tests {
|
||||
.update(new DataView(new Buffer('world').buffer)).digest('hex');
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_hash_int8array_test
|
||||
var hashResult: string = crypto.createHash('md5')
|
||||
.update(new Int8Array(new Buffer('world').buffer)).digest('hex');
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_hmac_string_test
|
||||
var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex');
|
||||
@@ -1058,6 +1064,12 @@ namespace crypto_tests {
|
||||
.update(new DataView(new Buffer('world').buffer)).digest('hex');
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_hmac_int8array_test
|
||||
var hmacResult: string = crypto.createHmac('md5', 'hello')
|
||||
.update(new Int8Array(new Buffer('world').buffer)).digest('hex');
|
||||
}
|
||||
|
||||
{
|
||||
let hmac: crypto.Hmac;
|
||||
(hmac = crypto.createHmac('md5', 'hello')).end('world', 'utf8', () => {
|
||||
@@ -1124,6 +1136,7 @@ namespace crypto_tests {
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_buffer_test
|
||||
let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]);
|
||||
let buffer2: Buffer = new Buffer([1, 2, 3, 4, 5]);
|
||||
let buffer3: Buffer = new Buffer([5, 4, 3, 2, 1]);
|
||||
@@ -1133,23 +1146,119 @@ namespace crypto_tests {
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_uint32array_test
|
||||
let arr1: Uint32Array = Uint32Array.of(1, 2, 3, 4, 5);
|
||||
let arr2: Uint32Array = Uint32Array.of(1, 2, 3, 4, 5);
|
||||
let arr3: Uint32Array = Uint32Array.of(5, 4, 3, 2, 1);
|
||||
|
||||
assert(crypto.timingSafeEqual(arr1, arr2));
|
||||
assert(!crypto.timingSafeEqual(arr1, arr3));
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_safe_typedarray_variant_test
|
||||
let arr1: Uint32Array = Uint32Array.of(1, 2, 3, 4, 5);
|
||||
let arr2: Int32Array = Int32Array.of(1, 2, 3, 4, 5);
|
||||
let arr3: Uint32Array = Uint32Array.of(5, 4, 3, 2, 1);
|
||||
|
||||
assert(crypto.timingSafeEqual(arr1, arr2));
|
||||
assert(!crypto.timingSafeEqual(arr1, arr3));
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_safe_int8array_variant_test
|
||||
let arr1: Int8Array = Int8Array.of(1, 2, 3, 4, 5, ~0, ~1, ~2, ~3, ~4);
|
||||
let arr2: Uint8Array = Uint8Array.of(1, 2, 3, 4, 5, ~0, ~1, ~2, ~3, ~4);
|
||||
let arr3: Uint8ClampedArray = Uint8ClampedArray.of(1, 2, 3, 4, 5, ~0, ~1, ~2, ~3, ~4);
|
||||
|
||||
assert(crypto.timingSafeEqual(arr1, arr2)); // binary same
|
||||
assert(!crypto.timingSafeEqual(arr1, arr3)); // binary differ
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_safe_arraybufferiew_variant_test
|
||||
/* throws as of v10.4.1 */
|
||||
// let arr1: Uint8Array = Uint8Array.of(1, 0, 2, 0, 3, 0, 4, 0);
|
||||
// let arr2: Uint16Array = Uint16Array.of(1, 2, 3, 4);
|
||||
// let arr3: Uint32Array = Uint8ClampedArray.of(131073, 262147);
|
||||
|
||||
// assert(crypto.timingSafeEqual(arr1, arr2)); // binary same
|
||||
// assert(crypto.timingSafeEqual(arr1, arr3)); // binary same
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_unsafe_arraybufferiew_variant_test
|
||||
/* dumps core as of v10.4.1 */
|
||||
// let arr1: Uint8Array = Uint8Array.of(1, 2, 3, 4);
|
||||
// let arr2: Uint16Array = Uint16Array.of(1, 2, 3, 4);
|
||||
// let arr3: Uint32Array = Uint8ClampedArray.of(1, 2, 3, 4);
|
||||
|
||||
// assert(!crypto.timingSafeEqual(arr1, arr2)); // dumps core
|
||||
// assert(!crypto.timingSafeEqual(arr1, arr3)); // dumps core
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_dataview_test
|
||||
let dv1B: Uint8Array = Uint8Array.of(1, 2, 3, 4, 5);
|
||||
let dv2B: Int8Array = Int8Array.of(1, 2, 3, 4, 5);
|
||||
let dv3B: Buffer = Buffer.of(5, 4, 3, 2, 1);
|
||||
let dv4B: Uint8ClampedArray = Uint8ClampedArray.of(5, 4, 3, 2, 1);
|
||||
let dv1: DataView = new DataView(dv1B.buffer, dv1B.byteOffset, dv1B.byteLength);
|
||||
let dv2: DataView = new DataView(dv2B.buffer, dv2B.byteOffset, dv2B.byteLength);
|
||||
let dv3: DataView = new DataView(dv3B.buffer, dv3B.byteOffset, dv3B.byteLength);
|
||||
let dv4: DataView = new DataView(dv4B.buffer, dv4B.byteOffset, dv4B.byteLength);
|
||||
|
||||
assert(crypto.timingSafeEqual(dv1, dv2));
|
||||
assert(crypto.timingSafeEqual(dv1, dv1B));
|
||||
assert(crypto.timingSafeEqual(dv2, dv1B));
|
||||
assert(crypto.timingSafeEqual(dv3, dv4));
|
||||
|
||||
assert(!crypto.timingSafeEqual(dv1, dv3));
|
||||
assert(!crypto.timingSafeEqual(dv2, dv3));
|
||||
assert(!crypto.timingSafeEqual(dv1, dv4));
|
||||
// ... I'm not going to write all those tests.
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_timingsafeequal_uint32array_test
|
||||
let ui32_1: Uint32Array = Uint32Array.of(1, 2, 3, 4, 5);
|
||||
let ui32_2: Uint32Array = Uint32Array.of(1, 2, 3, 4, 5);
|
||||
let ui32_3: Uint32Array = Uint32Array.of(5, 4, 3, 2, 1);
|
||||
|
||||
assert(crypto.timingSafeEqual(ui32_1, ui32_2));
|
||||
assert(!crypto.timingSafeEqual(ui32_1, ui32_3));
|
||||
}
|
||||
|
||||
{
|
||||
// crypto_randomfill_buffer_test
|
||||
let buffer: Buffer = new Buffer(10);
|
||||
crypto.randomFillSync(buffer);
|
||||
crypto.randomFillSync(buffer, 2);
|
||||
crypto.randomFillSync(buffer, 2, 3);
|
||||
|
||||
crypto.randomFill(buffer, (err: Error, buf: Buffer) => void {});
|
||||
crypto.randomFill(buffer, 2, (err: Error, buf: Buffer) => void {});
|
||||
crypto.randomFill(buffer, 2, 3, (err: Error, buf: Buffer) => void {});
|
||||
crypto.randomFill(buffer, (err: Error, buf: ArrayBufferView) => void {});
|
||||
crypto.randomFill(buffer, 2, (err: Error, buf: ArrayBufferView) => void {});
|
||||
crypto.randomFill(buffer, 2, 3, (err: Error, buf: ArrayBufferView) => void {});
|
||||
|
||||
let arr: Uint8Array = new Uint8Array(10);
|
||||
crypto.randomFillSync(arr);
|
||||
crypto.randomFillSync(arr, 2);
|
||||
crypto.randomFillSync(arr, 2, 3);
|
||||
// crypto_randomfill_uint8array_test
|
||||
let ui8arr: Uint8Array = new Uint8Array(10);
|
||||
crypto.randomFillSync(ui8arr);
|
||||
crypto.randomFillSync(ui8arr, 2);
|
||||
crypto.randomFillSync(ui8arr, 2, 3);
|
||||
|
||||
crypto.randomFill(arr, (err: Error, buf: Uint8Array) => void {});
|
||||
crypto.randomFill(arr, 2, (err: Error, buf: Uint8Array) => void {});
|
||||
crypto.randomFill(arr, 2, 3, (err: Error, buf: Uint8Array) => void {});
|
||||
crypto.randomFill(ui8arr, (err: Error, buf: ArrayBufferView) => void {});
|
||||
crypto.randomFill(ui8arr, 2, (err: Error, buf: ArrayBufferView) => void {});
|
||||
crypto.randomFill(ui8arr, 2, 3, (err: Error, buf: ArrayBufferView) => void {});
|
||||
|
||||
// crypto_randomfill_int32array_test
|
||||
let i32arr: Int32Array = new Int32Array(10);
|
||||
crypto.randomFillSync(i32arr);
|
||||
crypto.randomFillSync(i32arr, 2);
|
||||
crypto.randomFillSync(i32arr, 2, 3);
|
||||
|
||||
crypto.randomFill(i32arr, (err: Error, buf: ArrayBufferView) => void {});
|
||||
crypto.randomFill(i32arr, 2, (err: Error, buf: ArrayBufferView) => void {});
|
||||
crypto.randomFill(i32arr, 2, 3, (err: Error, buf: ArrayBufferView) => void {});
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
3230
types/office-js/index.d.ts
vendored
3230
types/office-js/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -316,3 +316,21 @@ async function test_interfaces() {
|
||||
range.set(rangeSettables);
|
||||
});
|
||||
}
|
||||
|
||||
async function testResumeExistingObject () {
|
||||
let range: Excel.Range;
|
||||
await Excel.run(async context => {
|
||||
range = context.workbook.getSelectedRange();
|
||||
await context.sync();
|
||||
});
|
||||
|
||||
await Excel.run(range, async context => {
|
||||
range.clear();
|
||||
await context.sync();
|
||||
});
|
||||
|
||||
await Excel.run({delayForCellEdit: true, previousObjects: range}, async context => {
|
||||
range.clear();
|
||||
await context.sync();
|
||||
});
|
||||
}
|
||||
|
||||
1
types/react-datepicker/index.d.ts
vendored
1
types/react-datepicker/index.d.ts
vendored
@@ -76,6 +76,7 @@ export interface ReactDatePickerProps {
|
||||
showWeekNumbers?: boolean;
|
||||
showYearDropdown?: boolean;
|
||||
startDate?: moment.Moment;
|
||||
startOpen?: boolean;
|
||||
tabIndex?: number;
|
||||
title?: string;
|
||||
todayButton?: string;
|
||||
|
||||
50
types/react-native/index.d.ts
vendored
50
types/react-native/index.d.ts
vendored
@@ -999,13 +999,6 @@ export interface TextInputIOSProps {
|
||||
*/
|
||||
keyboardAppearance?: "default" | "light" | "dark";
|
||||
|
||||
/**
|
||||
* Callback that is called when a key is pressed.
|
||||
* Pressed key value is passed as an argument to the callback handler.
|
||||
* Fires before onChange callbacks.
|
||||
*/
|
||||
onKeyPress?: (event: {nativeEvent: {key: string}}) => void;
|
||||
|
||||
/**
|
||||
* See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document
|
||||
*/
|
||||
@@ -1082,6 +1075,9 @@ export type ReturnKeyTypeAndroid = "none" | "previous";
|
||||
export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call";
|
||||
export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS;
|
||||
|
||||
/**
|
||||
* @see TextInputProps.onFocus
|
||||
*/
|
||||
export interface TextInputFocusEventData {
|
||||
target: number;
|
||||
text: string;
|
||||
@@ -1095,6 +1091,24 @@ export interface TextInputScrollEventData {
|
||||
contentOffset: { x: number; y: number; }
|
||||
}
|
||||
|
||||
/**
|
||||
* @see TextInputProps.onSelectionChange
|
||||
*/
|
||||
export interface TextInputSelectionChangeEventData {
|
||||
selection: {
|
||||
start: number;
|
||||
end: number;
|
||||
};
|
||||
target: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see TextInputProps.onKeyPress
|
||||
*/
|
||||
export interface TextInputKeyPressEventData {
|
||||
key: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/textinput.html#props
|
||||
*/
|
||||
@@ -1220,7 +1234,7 @@ export interface TextInputProps
|
||||
/**
|
||||
* Callback that is called when the text input selection is changed.
|
||||
*/
|
||||
onSelectionChange?: (event: { nativeEvent: { selection: { start: number; end: number }; target: number } }) => void;
|
||||
onSelectionChange?: (e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input's submit button is pressed.
|
||||
@@ -1235,6 +1249,17 @@ export interface TextInputProps
|
||||
*/
|
||||
onScroll?: (e: NativeSyntheticEvent<TextInputScrollEventData>) => void;
|
||||
|
||||
/**
|
||||
* Callback that is called when a key is pressed.
|
||||
* This will be called with
|
||||
* `{ nativeEvent: { key: keyValue } }`
|
||||
* where keyValue is 'Enter' or 'Backspace' for respective keys and the typed-in character otherwise including ' ' for space.
|
||||
*
|
||||
* Fires before onChange callbacks.
|
||||
* Note: on Android only the inputs from soft keyboard are handled, not the hardware keyboard inputs.
|
||||
*/
|
||||
onKeyPress?: (e: NativeSyntheticEvent<TextInputKeyPressEventData>) => void;
|
||||
|
||||
/**
|
||||
* The string that will be rendered before text input has been entered
|
||||
*/
|
||||
@@ -3629,6 +3654,13 @@ export interface ViewabilityConfig {
|
||||
waitForInteraction?: boolean;
|
||||
}
|
||||
|
||||
export interface ViewabilityConfigCallbackPair {
|
||||
viewabilityConfig: ViewabilityConfig;
|
||||
onViewableItemsChanged: ((info: { viewableItems: Array<ViewToken>; changed: Array<ViewToken> }) => void) | null;
|
||||
}
|
||||
|
||||
export type ViewabilityConfigCallbackPairs = ViewabilityConfigCallbackPair[];
|
||||
|
||||
/**
|
||||
* @see https://facebook.github.io/react-native/docs/flatlist.html#props
|
||||
*/
|
||||
@@ -4169,6 +4201,8 @@ export interface VirtualizedListProps<ItemT> extends ScrollViewProps {
|
||||
|
||||
viewabilityConfig?: ViewabilityConfig;
|
||||
|
||||
viewabilityConfigCallbackPairs?: ViewabilityConfigCallbackPairs;
|
||||
|
||||
/**
|
||||
* Determines the maximum number of items rendered outside of the visible area, in units of
|
||||
* visible lengths. So if your list fills the screen, then `windowSize={21}` (the default) will
|
||||
|
||||
@@ -56,7 +56,9 @@ import {
|
||||
StatusBar,
|
||||
NativeSyntheticEvent,
|
||||
GestureResponderEvent,
|
||||
TextInputScrollEventData
|
||||
TextInputScrollEventData,
|
||||
TextInputSelectionChangeEventData,
|
||||
TextInputKeyPressEventData,
|
||||
} from "react-native";
|
||||
|
||||
declare module "react-native" {
|
||||
@@ -492,6 +494,19 @@ class TextInputTest extends React.Component<{}, {username: string}> {
|
||||
testNativeSyntheticEvent(e);
|
||||
}
|
||||
|
||||
handleOnSelectionChange = (e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {
|
||||
testNativeSyntheticEvent(e);
|
||||
|
||||
console.log(`target: ${ e.nativeEvent.target }`);
|
||||
console.log(`start: ${ e.nativeEvent.selection.start }`);
|
||||
console.log(`end: ${ e.nativeEvent.selection.end }`);
|
||||
}
|
||||
|
||||
handleOnKeyPress = (e: NativeSyntheticEvent<TextInputKeyPressEventData>) => {
|
||||
testNativeSyntheticEvent(e);
|
||||
console.log(`key: ${ e.nativeEvent.key }`);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
@@ -503,7 +518,7 @@ class TextInputTest extends React.Component<{}, {username: string}> {
|
||||
onChangeText={this.handleUsernameChange}
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
<TextInput
|
||||
multiline
|
||||
onScroll={this.onScroll}
|
||||
/>
|
||||
@@ -512,6 +527,14 @@ class TextInputTest extends React.Component<{}, {username: string}> {
|
||||
onBlur={this.handleOnBlur}
|
||||
onFocus={this.handleOnFocus}
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
onSelectionChange={this.handleOnSelectionChange}
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
onKeyPress={this.handleOnKeyPress}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
2
types/react-navigation/index.d.ts
vendored
2
types/react-navigation/index.d.ts
vendored
@@ -1162,7 +1162,7 @@ export interface NavigationInjectedProps {
|
||||
|
||||
export function withNavigation<T = {}>(
|
||||
Component: React.ComponentType<T & NavigationInjectedProps>
|
||||
): React.ComponentType<T>;
|
||||
): React.ComponentType<T & { onRef?: React.Ref<typeof Component> }>;
|
||||
|
||||
export function withNavigationFocus<T = {}>(
|
||||
Component: React.ComponentType<T & NavigationInjectedProps>
|
||||
|
||||
@@ -40,6 +40,8 @@ import {
|
||||
NavigationPopToTopAction,
|
||||
NavigationScreenComponent,
|
||||
NavigationContainerComponent,
|
||||
withNavigation,
|
||||
NavigationInjectedProps,
|
||||
} from 'react-navigation';
|
||||
|
||||
// Constants
|
||||
@@ -514,3 +516,19 @@ class SetParamsTest extends React.Component<NavigationScreenProps<ScreenProps>>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Test withNavigation
|
||||
|
||||
interface BackButtonProps { title: string; }
|
||||
class MyBackButton extends React.Component<BackButtonProps & NavigationInjectedProps> {
|
||||
render() {
|
||||
return <button title={this.props.title} onClick={() => { this.props.navigation.goBack(); }} />;
|
||||
}
|
||||
}
|
||||
|
||||
// withNavigation returns a component that wraps MyBackButton and passes in the
|
||||
// navigation prop
|
||||
const BackButtonWithNavigation = withNavigation<BackButtonProps>(MyBackButton);
|
||||
const BackButtonInstance = <BackButtonWithNavigation
|
||||
title="Back" onRef={ref => { const backButtonRef = ref; }}
|
||||
/>;
|
||||
|
||||
14
types/react-redux-i18n/index.d.ts
vendored
14
types/react-redux-i18n/index.d.ts
vendored
@@ -31,14 +31,22 @@ declare module 'react-redux-i18n' {
|
||||
}
|
||||
|
||||
type TranslateProps = {
|
||||
className?: string;
|
||||
dangerousHTML?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
tag?: React.ReactType;
|
||||
value: string;
|
||||
[prop: string]: string;
|
||||
|
||||
[prop: string]: any;
|
||||
}
|
||||
|
||||
type LocalizeProps = {
|
||||
value: string | number;
|
||||
className?: string;
|
||||
dangerousHTML?: boolean;
|
||||
dateFormat?: string;
|
||||
options?: Object;
|
||||
style?: React.CSSProperties;
|
||||
tag?: React.ReactType;
|
||||
value: string | number | object;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
721
types/slate/index.d.ts
vendored
Normal file
721
types/slate/index.d.ts
vendored
Normal file
@@ -0,0 +1,721 @@
|
||||
// Type definitions for slate 0.33
|
||||
// Project: https://github.com/ianstormtaylor/slate
|
||||
// Definitions by: Andy Kent <https://github.com/andykent>
|
||||
// Jamie Talbot <https://github.com/majelbstoat>
|
||||
// Jan Löbel <https://github.com/JanLoebel>
|
||||
// Brandon Shelton <https://github.com/YangusKhan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
import * as Immutable from 'immutable';
|
||||
|
||||
export namespace Slate {
|
||||
interface Data {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface RulesByNodeType {
|
||||
[key: string]: Rules;
|
||||
}
|
||||
|
||||
interface KindsAndTypes {
|
||||
kinds?: string[];
|
||||
types?: string[];
|
||||
}
|
||||
|
||||
type InvalidReason =
|
||||
| 'child_kind_invalid'
|
||||
| 'child_required'
|
||||
| 'child_type_invalid'
|
||||
| 'child_unknown'
|
||||
| 'first_child_kind_invalid'
|
||||
| 'first_child_type_invalid'
|
||||
| 'last_child_kind_invalid'
|
||||
| 'last_child_type_invalid'
|
||||
| 'node_data_invalid'
|
||||
| 'node_is_void_invalid'
|
||||
| 'node_mark_invalid'
|
||||
| 'node_text_invalid'
|
||||
| 'parent_kind_invalid'
|
||||
| 'parent_type_invalid';
|
||||
|
||||
interface Rules {
|
||||
data?: {
|
||||
[key: string]: (v: any) => boolean;
|
||||
};
|
||||
first?: KindsAndTypes;
|
||||
isVoid?: boolean;
|
||||
last?: KindsAndTypes;
|
||||
nodes?: Array<{
|
||||
kinds?: string[];
|
||||
types?: string[];
|
||||
min?: number;
|
||||
max?: number;
|
||||
}>;
|
||||
normalize?: (
|
||||
change: Change,
|
||||
reason: InvalidReason,
|
||||
context: { [key: string]: any }
|
||||
) => void;
|
||||
parent?: KindsAndTypes;
|
||||
text?: RegExp;
|
||||
}
|
||||
|
||||
interface SchemaProperties {
|
||||
document?: Rules;
|
||||
blocks?: RulesByNodeType;
|
||||
inlines?: RulesByNodeType;
|
||||
}
|
||||
|
||||
class Schema extends Immutable.Record({}) {
|
||||
document: Rules;
|
||||
blocks: RulesByNodeType;
|
||||
inlines: RulesByNodeType;
|
||||
|
||||
static create(properties: SchemaProperties | Schema): Schema;
|
||||
static fromJSON(object: SchemaProperties): Schema;
|
||||
static isSchema(maybeSchema: any): maybeSchema is Schema;
|
||||
|
||||
toJSON(): SchemaProperties;
|
||||
}
|
||||
|
||||
interface ValueProperties {
|
||||
document?: Document;
|
||||
selection?: Range;
|
||||
history?: History;
|
||||
schema?: Schema;
|
||||
data?: Data;
|
||||
decorations?: Immutable.List<Range> | null;
|
||||
}
|
||||
|
||||
interface ValueJSON {
|
||||
document?: DocumentJSON;
|
||||
selection?: Range;
|
||||
history?: History;
|
||||
schema?: Schema;
|
||||
data?: Data;
|
||||
decorations?: Immutable.List<Range> | null;
|
||||
object?: 'value';
|
||||
}
|
||||
|
||||
class Value extends Immutable.Record({}) {
|
||||
document: Document;
|
||||
selection: Range;
|
||||
history: History;
|
||||
schema: Schema;
|
||||
data: Data;
|
||||
object: 'value';
|
||||
decorations: Immutable.List<Range> | null;
|
||||
|
||||
readonly anchorText: Text;
|
||||
readonly focusText: Text;
|
||||
readonly startText: Text;
|
||||
readonly endText: Text;
|
||||
|
||||
readonly anchorBlock: Block;
|
||||
readonly focusBlock: Block;
|
||||
readonly startBlock: Block;
|
||||
readonly endBlock: Block;
|
||||
|
||||
readonly marks: Immutable.Set<Mark>;
|
||||
readonly activeMarks: Immutable.Set<Mark>;
|
||||
readonly blocks: Immutable.List<Block>;
|
||||
readonly fragment: Document;
|
||||
readonly inlines: Immutable.List<Inline>;
|
||||
readonly text: Immutable.List<Text>;
|
||||
readonly characters: Immutable.List<Character>;
|
||||
readonly hasUndos: boolean;
|
||||
readonly hasRedos: boolean;
|
||||
|
||||
readonly anchorKey: string;
|
||||
readonly focusKey: string;
|
||||
readonly startKey: string;
|
||||
readonly endKey: string;
|
||||
readonly anchorOffset: number;
|
||||
readonly focusOffset: number;
|
||||
readonly startOffset: number;
|
||||
readonly endOffset: number;
|
||||
readonly isBackward: boolean;
|
||||
readonly isBlurred: boolean;
|
||||
readonly isCollapsed: boolean;
|
||||
readonly isExpanded: boolean;
|
||||
readonly isFocused: boolean;
|
||||
readonly isForward: boolean;
|
||||
|
||||
static create(properties?: ValueProperties | Value): Value;
|
||||
static fromJSON(properties: ValueJSON): Value;
|
||||
static isValue(maybeValue: any): maybeValue is Value;
|
||||
|
||||
change(): Change;
|
||||
toJSON(): ValueJSON;
|
||||
}
|
||||
|
||||
interface DocumentProperties {
|
||||
nodes?: Immutable.List<Node> | Node[];
|
||||
key?: string;
|
||||
data?: Immutable.Map<string, any> | { [key: string]: any };
|
||||
}
|
||||
|
||||
interface DocumentJSON {
|
||||
nodes?: NodeJSON[];
|
||||
key?: string;
|
||||
data?: { [key: string]: any };
|
||||
object?: 'document';
|
||||
}
|
||||
|
||||
class Document<DataMap = { [key: string]: any }> extends BaseNode<
|
||||
DataMap
|
||||
> {
|
||||
object: 'document';
|
||||
nodes: Immutable.List<Block>;
|
||||
|
||||
static create(
|
||||
properties: DocumentProperties | Document | Immutable.List<Node> | Node[]
|
||||
): Document;
|
||||
static fromJSON(properties: DocumentProperties | Document): Document;
|
||||
static isDocument(maybeDocument: any): maybeDocument is Document;
|
||||
|
||||
toJSON(): DocumentJSON;
|
||||
}
|
||||
|
||||
interface BlockProperties {
|
||||
type: string;
|
||||
key?: string;
|
||||
nodes?: Immutable.List<Node>;
|
||||
isVoid?: boolean;
|
||||
data?: Immutable.Map<string, any> | { [key: string]: any };
|
||||
}
|
||||
|
||||
interface BlockJSON {
|
||||
type: string;
|
||||
key?: string;
|
||||
nodes?: NodeJSON[];
|
||||
isVoid?: boolean;
|
||||
data?: { [key: string]: any };
|
||||
object: 'block';
|
||||
}
|
||||
|
||||
class Block extends BaseNode {
|
||||
isVoid: boolean;
|
||||
object: 'block';
|
||||
nodes: Immutable.List<Block | Text | Inline>;
|
||||
|
||||
static create(properties: BlockProperties | Block | string): Block;
|
||||
static createList(
|
||||
array: (BlockProperties[] | Block[] | string[])
|
||||
): Immutable.List<Block>;
|
||||
static fromJSON(properties: BlockProperties | Block): Block;
|
||||
static isBlock(maybeBlock: any): maybeBlock is Block;
|
||||
|
||||
toJSON(): BlockJSON;
|
||||
}
|
||||
|
||||
interface InlineProperties {
|
||||
type: string;
|
||||
key?: string;
|
||||
nodes?: Immutable.List<Node>;
|
||||
isVoid?: boolean;
|
||||
data?: Immutable.Map<string, any> | { [key: string]: any };
|
||||
}
|
||||
|
||||
interface InlineJSON {
|
||||
type: string;
|
||||
key?: string;
|
||||
nodes?: NodeJSON[];
|
||||
isVoid?: boolean;
|
||||
data?: { [key: string]: any };
|
||||
object: 'inline';
|
||||
}
|
||||
|
||||
class Inline extends BaseNode {
|
||||
isVoid: boolean;
|
||||
object: 'inline';
|
||||
nodes: Immutable.List<Inline | Text>;
|
||||
|
||||
static create(properties: InlineProperties | Inline | string): Inline;
|
||||
static createList(
|
||||
array: (InlineProperties[] | Inline[] | string[])
|
||||
): Immutable.List<Inline>;
|
||||
static fromJSON(properties: InlineProperties | Inline): Inline;
|
||||
static isInline(maybeInline: any): maybeInline is Inline;
|
||||
|
||||
toJSON(): InlineJSON;
|
||||
}
|
||||
|
||||
interface Leaf {
|
||||
marks?: Mark[];
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface TextProperties {
|
||||
key?: string;
|
||||
characters: Immutable.List<Character>;
|
||||
}
|
||||
|
||||
interface TextJSON {
|
||||
key?: string;
|
||||
characters?: Character[];
|
||||
leaves: Leaf[];
|
||||
object: 'text';
|
||||
}
|
||||
|
||||
class Text extends Immutable.Record({}) {
|
||||
object: 'text';
|
||||
characters: Immutable.List<Character>;
|
||||
key: string;
|
||||
text: string;
|
||||
|
||||
static create(properties: TextProperties | Text | string): Text;
|
||||
static fromJSON(properties: TextProperties | Text): Text;
|
||||
static isText(maybeText: any): maybeText is Text;
|
||||
|
||||
toJSON(): TextJSON;
|
||||
}
|
||||
|
||||
type Node = Document | Block | Inline | Text;
|
||||
type NodeJSON = DocumentJSON | BlockJSON | InlineJSON | TextJSON;
|
||||
|
||||
class BaseNode<DataMap = { [key: string]: any }> extends Immutable.Record(
|
||||
{}
|
||||
) {
|
||||
data: Immutable.Map<keyof DataMap, DataMap[keyof DataMap]>;
|
||||
type: string;
|
||||
key: string;
|
||||
object: 'document' | 'block' | 'inline' | 'text';
|
||||
nodes: Immutable.List<Node>;
|
||||
readonly text: string;
|
||||
|
||||
filterDescendants(iterator: (node: Node) => boolean): Immutable.List<Node>;
|
||||
findDescendants(iterator: (node: Node) => boolean): Node | null;
|
||||
getBlocksAtRange(range: Range): Immutable.List<Block>;
|
||||
getBlocks(): Immutable.List<Block>;
|
||||
getCharactersAtRange(range: Range): Immutable.List<Character>;
|
||||
getChild(key: string | Node): Node | null;
|
||||
getClosestBlock(key: string | Node): Block | null;
|
||||
getClosestInline(key: string | Node): Inline | null;
|
||||
getClosest(key: string | Node, match: (node: Node) => boolean): Node | null;
|
||||
getDepth(key: string | Node): number;
|
||||
getDescendant(key: string | Node): Node | null;
|
||||
getFirstText(): Text | null;
|
||||
getFragmentAtRange(range: Range): Document;
|
||||
getFurthest(key: string, iterator: (node: Node) => boolean): Node | null;
|
||||
getFurthestAncestor(key: string): Node | null;
|
||||
getFurthestBlock(key: string): Block | null;
|
||||
getFurthestInline(key: string): Inline | null;
|
||||
getFurthestOnlyChildAncestor(key: string): Node | null;
|
||||
getInlinesAtRange(range: Range): Immutable.List<Inline>;
|
||||
getLastText(): Text | null;
|
||||
getMarksAtRange(range: Range): Immutable.Set<Mark>;
|
||||
getNextBlock(key: string | Node): Block | null;
|
||||
getNextSibling(key: string | Node): Node | null;
|
||||
getNextText(key: string | Node): Text | null;
|
||||
getParent(key: string | Node): Node | null;
|
||||
getPreviousBlock(key: string | Node): Block | null;
|
||||
getPreviousSibling(key: string | Node): Node | null;
|
||||
getPreviousText(key: string | Node): Text | null;
|
||||
getTexts(): Immutable.List<Text>;
|
||||
getTextsAsArray(): Text[];
|
||||
getTextAtOffset(offset: number): Text | null;
|
||||
getTextsAtRange(range: Range): Immutable.List<Text>;
|
||||
getTextsAtRangeAsArray(range: Range): Text[];
|
||||
hasChild(key: string | Node): boolean;
|
||||
}
|
||||
|
||||
interface CharacterProperties {
|
||||
marks?: Immutable.Set<Mark> | Mark[];
|
||||
text: string;
|
||||
}
|
||||
|
||||
class Character extends Immutable.Record({}) {
|
||||
object: 'character';
|
||||
marks: Immutable.Set<Mark>;
|
||||
text: string;
|
||||
|
||||
static create(
|
||||
properties: CharacterProperties | Character | string
|
||||
): Character;
|
||||
static createList(
|
||||
array: (CharacterProperties[] | Character[] | string[])
|
||||
): Immutable.List<Character>;
|
||||
static fromJSON(properties: CharacterProperties | Character): Character;
|
||||
static isCharacter(maybeCharacter: any): maybeCharacter is Character;
|
||||
|
||||
toJSON(): CharacterProperties;
|
||||
}
|
||||
|
||||
interface MarkProperties {
|
||||
type: string;
|
||||
data?: Immutable.Map<string, any> | { [key: string]: any };
|
||||
}
|
||||
|
||||
interface MarkJSON {
|
||||
type: string;
|
||||
data?: { [key: string]: any };
|
||||
}
|
||||
|
||||
class Mark extends Immutable.Record({}) {
|
||||
object: 'mark';
|
||||
type: string;
|
||||
data: Immutable.Map<string, any>;
|
||||
|
||||
static create(properties: MarkProperties | Mark | string): Mark;
|
||||
static createSet(
|
||||
array: (MarkProperties[] | Mark[] | string[])
|
||||
): Immutable.Set<Mark>;
|
||||
static fromJSON(properties: MarkJSON | Mark): Mark;
|
||||
static isMark(maybeMark: any): maybeMark is Mark;
|
||||
|
||||
toJSON(): MarkProperties;
|
||||
}
|
||||
|
||||
class Change extends Immutable.Record({}) {
|
||||
object: 'change';
|
||||
value: Value;
|
||||
operations: Immutable.List<Operation>;
|
||||
|
||||
call(customChange: (change: Change, ...args: any[]) => Change): Change;
|
||||
|
||||
applyOperations(operations: Operation[]): Change;
|
||||
applyOperation(operation: Operation): Change;
|
||||
|
||||
// Full Value Change
|
||||
setValue(properties: Value | ValueProperties): Change;
|
||||
|
||||
// Current Value Changes
|
||||
deleteBackward(n: number): Change;
|
||||
deleteForward(n: number): Change;
|
||||
delete(): Change;
|
||||
insertBlock(block: Block | BlockProperties | string): Change;
|
||||
insertFragment(fragment: Document): Change;
|
||||
insertInline(inline: Inline | InlineProperties): Change;
|
||||
insertText(text: string): Change;
|
||||
addMark(mark: Mark | MarkProperties | string): Change;
|
||||
setBlocks(properties: BlockProperties | string): Change;
|
||||
setInlines(properties: InlineProperties | string): Change;
|
||||
splitBlock(depth: number): Change;
|
||||
splitInline(depth: number): Change;
|
||||
removeMark(mark: Mark | MarkProperties | string): Change;
|
||||
toggleMark(mark: Mark | MarkProperties | string): Change;
|
||||
unwrapBlock(properties: BlockProperties | string): Change;
|
||||
unwrapInline(properties: InlineProperties | string): Change;
|
||||
wrapBlock(properties: BlockProperties | string): Change;
|
||||
wrapInline(properties: InlineProperties | string): Change;
|
||||
wrapText(prefix: string, suffix?: string): Change;
|
||||
|
||||
// Selection Changes
|
||||
blur(): Change;
|
||||
collapseToAnchor(): Change;
|
||||
collapseToFocus(): Change;
|
||||
collapseToStart(): Change;
|
||||
collapseToEnd(): Change;
|
||||
collapseToStartOf(node: Node): Change;
|
||||
collapseToEndOf(node: Node): Change;
|
||||
collapseToStartOfNextBlock(): Change;
|
||||
collapseToEndOfNextBlock(): Change;
|
||||
collapseToStartOfPreviousBlock(): Change;
|
||||
collapseToEndOfPreviousBlock(): Change;
|
||||
collapseToStartOfNextText(): Change;
|
||||
collapseToEndOfNextText(): Change;
|
||||
collapseToStartOfPreviousText(): Change;
|
||||
collapseToEndOfPreviousText(): Change;
|
||||
extend(n: number): Change;
|
||||
extendToStartOf(node: Node): Change;
|
||||
extendToEndOf(node: Node): Change;
|
||||
flip(): Change;
|
||||
focus(): Change;
|
||||
move(n: number): Change;
|
||||
moveStart(n: number): Change;
|
||||
moveEnd(n: number): Change;
|
||||
moveOffsetsTo(anchorOffset: number, focusOffset: number): Change;
|
||||
moveToRangeOf(node: Node): Change;
|
||||
select(properties: Range | RangeProperties): Change;
|
||||
selectAll(): Change;
|
||||
deselect(): Change;
|
||||
|
||||
// Document Changes
|
||||
deleteBackwardAtRange(range: Range, n: number): Change;
|
||||
deleteForwardAtRange(range: Range, n: number): Change;
|
||||
deleteAtRange(range: Range): Change;
|
||||
insertBlockAtRange(
|
||||
range: Range,
|
||||
block: Block | BlockProperties | string
|
||||
): Change;
|
||||
insertFragmentAtRange(range: Range, fragment: Document): Change;
|
||||
insertInlineAtRange(
|
||||
range: Range,
|
||||
inline: Inline | InlineProperties
|
||||
): Change;
|
||||
insertTextAtRange(range: Range, text: string): Change;
|
||||
addMarkAtRange(range: Range, mark: Mark | MarkProperties | string): Change;
|
||||
setBlocksAtRange(range: Range, properties: BlockProperties | string): Change;
|
||||
setInlinesAtRange(
|
||||
range: Range,
|
||||
properties: InlineProperties | string
|
||||
): Change;
|
||||
splitBlockAtRange(range: Range, depth: number): Change;
|
||||
splitInlineAtRange(range: Range, depth: number): Change;
|
||||
removeMarkAtRange(
|
||||
range: Range,
|
||||
mark: Mark | MarkProperties | string
|
||||
): Change;
|
||||
toggleMarkAtRange(
|
||||
range: Range,
|
||||
mark: Mark | MarkProperties | string
|
||||
): Change;
|
||||
unwrapBlockAtRange(
|
||||
range: Range,
|
||||
properties: BlockProperties | string
|
||||
): Change;
|
||||
unwrapInlineAtRange(
|
||||
range: Range,
|
||||
properties: InlineProperties | string
|
||||
): Change;
|
||||
wrapBlockAtRange(
|
||||
range: Range,
|
||||
properties: BlockProperties | string
|
||||
): Change;
|
||||
wrapInlineAtRange(
|
||||
range: Range,
|
||||
properties: InlineProperties | string
|
||||
): Change;
|
||||
wrapTextAtRange(range: Range, prefix: string, suffix?: string): Change;
|
||||
|
||||
// Node Changes
|
||||
addMarkByKey(
|
||||
key: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
mark: Mark
|
||||
): Change;
|
||||
insertNodeByKey(key: string, index: number, node: Node): Change;
|
||||
insertFragmentByKey(key: string, index: number, fragment: Document): Change;
|
||||
insertTextByKey(
|
||||
key: string,
|
||||
offset: number,
|
||||
text: string,
|
||||
marks?: Immutable.Set<Mark> | Mark[]
|
||||
): Change;
|
||||
moveNodeByKey(key: string, newKey: string, newIndex: number): Change;
|
||||
removeMarkByKey(
|
||||
key: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
mark: Mark
|
||||
): Change;
|
||||
removeNodeByKey(key: string): Change;
|
||||
replaceNodeByKey(key: string, node: Node): Change;
|
||||
removeTextByKey(key: string, offset: number, length: number): Change;
|
||||
setMarkByKey(
|
||||
key: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
mark: Mark,
|
||||
properties: MarkProperties
|
||||
): Change;
|
||||
setNodeByKey(
|
||||
key: string,
|
||||
properties: BlockProperties | InlineProperties | string
|
||||
): Change;
|
||||
splitNodeByKey(key: string, offset: number): Change;
|
||||
unwrapInlineByKey(
|
||||
key: string,
|
||||
properties: InlineProperties | string
|
||||
): Change;
|
||||
unwrapBlockByKey(key: string, properties: BlockProperties | string): Change;
|
||||
unwrapNodeByKey(key: string): Change;
|
||||
wrapInlineByKey(key: string, properties: InlineProperties | string): Change;
|
||||
wrapBlockByKey(key: string, properties: BlockProperties | string): Change;
|
||||
|
||||
// History Changes
|
||||
redo(): Change;
|
||||
undo(): Change;
|
||||
}
|
||||
|
||||
interface RangeProperties {
|
||||
anchorKey?: string | null;
|
||||
anchorOffset?: number;
|
||||
focusKey?: string | null;
|
||||
focusOffset?: number;
|
||||
isFocused?: boolean;
|
||||
isBackward?: boolean | null;
|
||||
marks?: Immutable.Set<Mark> | null;
|
||||
}
|
||||
|
||||
interface RangeJSON {
|
||||
anchorKey?: string | null;
|
||||
anchorOffset?: number;
|
||||
focusKey?: string | null;
|
||||
focusOffset?: number;
|
||||
isFocused?: boolean;
|
||||
isBackward?: boolean | null;
|
||||
marks?: MarkJSON[] | null;
|
||||
}
|
||||
|
||||
class Range extends Immutable.Record({}) {
|
||||
object: 'range';
|
||||
anchorKey: string | null;
|
||||
anchorOffset: number;
|
||||
focusKey: string | null;
|
||||
focusOffset: number;
|
||||
isFocused: boolean;
|
||||
isBackward: boolean | null;
|
||||
marks: Immutable.Set<Mark> | null;
|
||||
|
||||
readonly isBlurred: boolean;
|
||||
readonly isCollapsed: boolean;
|
||||
readonly isExpanded: boolean;
|
||||
readonly isForward: boolean;
|
||||
readonly startKey: string;
|
||||
readonly startOffset: number;
|
||||
readonly endKey: string;
|
||||
readonly endOffset: number;
|
||||
|
||||
static create(properties: RangeProperties | Range): Range;
|
||||
static fromJSON(properties: RangeJSON): Range;
|
||||
static isRange(maybeRange: any): maybeRange is Range;
|
||||
|
||||
toJSON(): RangeProperties;
|
||||
|
||||
hasAnchorAtStartOf(node: Node): boolean;
|
||||
hasFocusAtStartOf(node: Node): boolean;
|
||||
hasStartAtStartOf(node: Node): boolean;
|
||||
hasEndAtStartOf(node: Node): boolean;
|
||||
hasEdgeAtStartOf(node: Node): boolean;
|
||||
|
||||
hasAnchorAtEndOf(node: Node): boolean;
|
||||
hasFocusAtEndOf(node: Node): boolean;
|
||||
hasStartAtEndOf(node: Node): boolean;
|
||||
hasEndAtEndOf(node: Node): boolean;
|
||||
hasEdgeAtEndOf(node: Node): boolean;
|
||||
|
||||
hasAnchorBetween(node: Node, start: number, end: number): boolean;
|
||||
hasFocusBetween(node: Node, start: number, end: number): boolean;
|
||||
hasStartBetween(node: Node, start: number, end: number): boolean;
|
||||
hasEndBetween(node: Node, start: number, end: number): boolean;
|
||||
hasEdgeBetween(node: Node, start: number, end: number): boolean;
|
||||
|
||||
hasAnchorIn(node: Node): boolean;
|
||||
hasFocusIn(node: Node): boolean;
|
||||
hasStartIn(node: Node): boolean;
|
||||
hasEndIn(node: Node): boolean;
|
||||
hasEdgeIn(node: Node): boolean;
|
||||
|
||||
isAtStartOf(node: Node): boolean;
|
||||
isAtEndOf(node: Node): boolean;
|
||||
}
|
||||
|
||||
type Operation =
|
||||
| InsertTextOperation
|
||||
| RemoveTextOperation
|
||||
| AddMarkOperation
|
||||
| RemoveMarkOperation
|
||||
| SetMarkOperation
|
||||
| InsertNodeOperation
|
||||
| MergeNodeOperation
|
||||
| MoveNodeOperation
|
||||
| RemoveNodeOperation
|
||||
| SetNodeOperation
|
||||
| SplitNodeOperation
|
||||
| SetSelectionOperation
|
||||
| SetValueOperation;
|
||||
|
||||
interface InsertTextOperation {
|
||||
type: 'insert_text';
|
||||
path: number[];
|
||||
offset: number;
|
||||
text: string;
|
||||
marks: Mark[];
|
||||
}
|
||||
|
||||
interface RemoveTextOperation {
|
||||
type: 'remove_text';
|
||||
path: number[];
|
||||
offset: number;
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface AddMarkOperation {
|
||||
type: 'add_mark';
|
||||
path: number[];
|
||||
offset: number;
|
||||
length: number;
|
||||
mark: Mark;
|
||||
}
|
||||
|
||||
interface RemoveMarkOperation {
|
||||
type: 'remove_mark';
|
||||
path: number[];
|
||||
offset: number;
|
||||
length: number;
|
||||
mark: Mark;
|
||||
}
|
||||
|
||||
interface SetMarkOperation {
|
||||
type: 'set_mark';
|
||||
path: number[];
|
||||
offset: number;
|
||||
length: number;
|
||||
mark: Mark;
|
||||
properties: MarkProperties;
|
||||
}
|
||||
|
||||
interface InsertNodeOperation {
|
||||
type: 'insert_node';
|
||||
path: number[];
|
||||
node: Node;
|
||||
}
|
||||
|
||||
interface MergeNodeOperation {
|
||||
type: 'merge_node';
|
||||
path: number[];
|
||||
position: number;
|
||||
}
|
||||
|
||||
interface MoveNodeOperation {
|
||||
type: 'move_node';
|
||||
path: number[];
|
||||
newPath: number[];
|
||||
}
|
||||
|
||||
interface RemoveNodeOperation {
|
||||
type: 'remove_node';
|
||||
path: number[];
|
||||
node: Node;
|
||||
}
|
||||
|
||||
interface SetNodeOperation {
|
||||
type: 'set_node';
|
||||
path: number[];
|
||||
properties: BlockProperties | InlineProperties | TextProperties;
|
||||
}
|
||||
|
||||
interface SplitNodeOperation {
|
||||
type: 'split_node';
|
||||
path: number[];
|
||||
position: number;
|
||||
target: number;
|
||||
}
|
||||
|
||||
interface SetSelectionOperation {
|
||||
type: 'set_selection';
|
||||
properties: RangeProperties;
|
||||
selection: Range;
|
||||
}
|
||||
|
||||
interface SetValueOperation {
|
||||
type: 'set_value';
|
||||
properties: ValueProperties;
|
||||
value: Value;
|
||||
}
|
||||
|
||||
const Operations: {
|
||||
apply: (value: Value, operation: Operation) => Value;
|
||||
invert: (operation: Operation) => Operation;
|
||||
};
|
||||
|
||||
class Stack extends Immutable.Record({}) {
|
||||
plugins: any[];
|
||||
}
|
||||
|
||||
function setKeyGenerator(func: () => string): null;
|
||||
function resetKeyGenerator(): null;
|
||||
}
|
||||
6
types/slate/package.json
Normal file
6
types/slate/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"immutable": "^3.8.2"
|
||||
}
|
||||
}
|
||||
21
types/slate/slate-tests.ts
Normal file
21
types/slate/slate-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Slate } from "slate";
|
||||
|
||||
const value = Slate.Value.create();
|
||||
value.change()
|
||||
.focus()
|
||||
.selectAll()
|
||||
.delete()
|
||||
.insertText('A bit of rich text, followed by...')
|
||||
.moveOffsetsTo(10, 14)
|
||||
.addMark('bold')
|
||||
.collapseToEndOfNextBlock()
|
||||
.insertBlock({
|
||||
type: 'image',
|
||||
isVoid: true,
|
||||
data: {
|
||||
src: 'http://placekitten.com/200/300',
|
||||
alt: 'Kittens',
|
||||
className: 'img-responsive',
|
||||
},
|
||||
})
|
||||
.insertBlock('paragraph');
|
||||
22
types/slate/tsconfig.json
Normal file
22
types/slate/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"slate-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/slate/tslint.json
Normal file
3
types/slate/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
2
types/three/index.d.ts
vendored
2
types/three/index.d.ts
vendored
@@ -45,10 +45,12 @@ export * from "./three-projector";
|
||||
export * from "./three-renderpass";
|
||||
export * from "./three-shaderpass";
|
||||
export * from "./three-smaapass";
|
||||
export * from "./three-ssaapass";
|
||||
export * from "./three-filmpass";
|
||||
export * from "./three-tgaloader";
|
||||
export * from "./three-trackballcontrols";
|
||||
export * from "./three-transformcontrols";
|
||||
export * from "./three-unrealbloompass";
|
||||
export * from "./three-vrcontrols";
|
||||
export * from "./three-vreffect";
|
||||
|
||||
|
||||
422
types/three/three-core.d.ts
vendored
422
types/three/three-core.d.ts
vendored
@@ -1843,43 +1843,43 @@ export class Raycaster {
|
||||
* @param origin The origin vector where the ray casts from.
|
||||
* @param direction The direction vector that gives direction to the ray. Should be normalized.
|
||||
* @param near All results returned are further away than near. Near can't be negative. Default value is 0.
|
||||
* @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
|
||||
* @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
|
||||
*/
|
||||
constructor(origin?: Vector3, direction?: Vector3, near?: number, far?: number);
|
||||
|
||||
/** The Ray used for the raycasting. */
|
||||
ray: Ray;
|
||||
|
||||
|
||||
/**
|
||||
* The near factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be smaller than the far property.
|
||||
* The near factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be smaller than the far property.
|
||||
*/
|
||||
near: number;
|
||||
|
||||
|
||||
/**
|
||||
* The far factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be larger than the near property.
|
||||
* The far factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be larger than the near property.
|
||||
*/
|
||||
far: number;
|
||||
|
||||
|
||||
params: RaycasterParameters;
|
||||
|
||||
/**
|
||||
* The precision factor of the raycaster when intersecting Line objects.
|
||||
* The precision factor of the raycaster when intersecting Line objects.
|
||||
*/
|
||||
linePrecision: number;
|
||||
|
||||
/**
|
||||
* Updates the ray with a new origin and direction.
|
||||
* Updates the ray with a new origin and direction.
|
||||
* @param origin The origin vector where the ray casts from.
|
||||
* @param direction The normalized direction vector that gives direction to the ray.
|
||||
* @param direction The normalized direction vector that gives direction to the ray.
|
||||
*/
|
||||
set(origin: Vector3, direction: Vector3): void;
|
||||
|
||||
/**
|
||||
* Updates the ray with a new origin and direction.
|
||||
* Updates the ray with a new origin and direction.
|
||||
* @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1.
|
||||
* @param camera camera from which the ray should originate
|
||||
* @param camera camera from which the ray should originate
|
||||
*/
|
||||
setFromCamera(coords: { x: number; y: number; }, camera: Camera ): void;
|
||||
|
||||
@@ -1887,15 +1887,15 @@ export class Raycaster {
|
||||
* Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
|
||||
* @param object The object to check for intersection with the ray.
|
||||
* @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false.
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
*/
|
||||
intersectObject(object: Object3D, recursive?: boolean, optionalTarget?: Intersection[]): Intersection[];
|
||||
|
||||
/**
|
||||
* Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject.
|
||||
* Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject.
|
||||
* @param objects The objects to check for intersection with the ray.
|
||||
* @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false.
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
*/
|
||||
intersectObjects(objects: Object3D[], recursive?: boolean, optionalTarget?: Intersection[]): Intersection[];
|
||||
}
|
||||
@@ -4261,49 +4261,62 @@ export class Triangle {
|
||||
* v.addVectors(new THREE.Vector2(0, 1), new THREE.Vector2(2, 3)); // invalid but compiled successfully
|
||||
*/
|
||||
export interface Vector {
|
||||
setComponent(index: number, value: number): void;
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
getComponent(index: number): number;
|
||||
|
||||
set(...args: number[]): this;
|
||||
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* copy(v:T):T;
|
||||
*/
|
||||
copy(v: this): this;
|
||||
copy(v: Vector): this;
|
||||
|
||||
/**
|
||||
* NOTE: The second argument is deprecated.
|
||||
*
|
||||
* add(v:T):T;
|
||||
*/
|
||||
add(v: Vector): Vector;
|
||||
add(v: Vector, w?: Vector): this;
|
||||
|
||||
/**
|
||||
* addVectors(a:T, b:T):T;
|
||||
*/
|
||||
addVectors(a: Vector, b: Vector): Vector;
|
||||
addVectors(a: Vector, b: Vector): this;
|
||||
|
||||
addScaledVector(vector: Vector, scale: number): this;
|
||||
|
||||
/**
|
||||
* Adds the scalar value s to this vector's values.
|
||||
*/
|
||||
addScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* sub(v:T):T;
|
||||
*/
|
||||
sub(v: Vector): Vector;
|
||||
sub(v: Vector): this;
|
||||
|
||||
/**
|
||||
* subVectors(a:T, b:T):T;
|
||||
*/
|
||||
subVectors(a: Vector, b: Vector): Vector;
|
||||
subVectors(a: Vector, b: Vector): this;
|
||||
|
||||
/**
|
||||
* multiplyScalar(s:number):T;
|
||||
*/
|
||||
multiplyScalar(s: number): Vector;
|
||||
multiplyScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* divideScalar(s:number):T;
|
||||
*/
|
||||
divideScalar(s: number): Vector;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* negate():T;
|
||||
*/
|
||||
negate(): Vector;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* dot(v:T):T;
|
||||
@@ -4323,7 +4336,7 @@ export interface Vector {
|
||||
/**
|
||||
* normalize():T;
|
||||
*/
|
||||
normalize(): Vector;
|
||||
normalize(): this;
|
||||
|
||||
/**
|
||||
* NOTE: Vector4 doesn't have the property.
|
||||
@@ -4342,12 +4355,12 @@ export interface Vector {
|
||||
/**
|
||||
* setLength(l:number):T;
|
||||
*/
|
||||
setLength(l: number): Vector;
|
||||
setLength(l: number): this;
|
||||
|
||||
/**
|
||||
* lerp(v:T, alpha:number):T;
|
||||
*/
|
||||
lerp(v: Vector, alpha: number): Vector;
|
||||
lerp(v: Vector, alpha: number): this;
|
||||
|
||||
/**
|
||||
* equals(v:T):boolean;
|
||||
@@ -4357,7 +4370,7 @@ export interface Vector {
|
||||
/**
|
||||
* clone():T;
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4372,40 +4385,43 @@ export class Vector2 implements Vector {
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
isVector2: true;
|
||||
|
||||
/**
|
||||
* Sets value of this vector.
|
||||
*/
|
||||
set(x: number, y: number): Vector2;
|
||||
set(x: number, y: number): this;
|
||||
|
||||
/**
|
||||
* Sets the x and y values of this vector both equal to scalar.
|
||||
*/
|
||||
setScalar(scalar: number): Vector2;
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets X component of this vector.
|
||||
*/
|
||||
setX(x: number): Vector2;
|
||||
setX(x: number): this;
|
||||
|
||||
/**
|
||||
* Sets Y component of this vector.
|
||||
*/
|
||||
setY(y: number): Vector2;
|
||||
setY(y: number): this;
|
||||
|
||||
/**
|
||||
* Sets a component of this vector.
|
||||
*/
|
||||
setComponent(index: number, value: number): void;
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
/**
|
||||
* Gets a component of this vector.
|
||||
*/
|
||||
getComponent(index: number): number;
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
* Returns a new Vector2 instance with the same `x` and `y` values.
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector2;
|
||||
|
||||
/**
|
||||
* Copies value of v to this vector.
|
||||
*/
|
||||
@@ -4414,65 +4430,73 @@ export class Vector2 implements Vector {
|
||||
/**
|
||||
* Adds v to this vector.
|
||||
*/
|
||||
add(v: Vector2): Vector2;
|
||||
add(v: Vector2, w?: Vector2): this;
|
||||
|
||||
/**
|
||||
* Adds the scalar value s to this vector's x and y values.
|
||||
*/
|
||||
addScalar(s: number): Vector2;
|
||||
addScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a + b.
|
||||
*/
|
||||
addVectors(a: Vector2, b: Vector2): Vector2;
|
||||
addVectors(a: Vector2, b: Vector2): this;
|
||||
|
||||
/**
|
||||
* Adds the multiple of v and s to this vector.
|
||||
*/
|
||||
addScaledVector(v: Vector2, s: number): Vector2;
|
||||
addScaledVector(v: Vector2, s: number): this;
|
||||
|
||||
/**
|
||||
* Subtracts v from this vector.
|
||||
*/
|
||||
sub(v: Vector2): Vector2;
|
||||
sub(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* Subtracts s from this vector's x and y components.
|
||||
*/
|
||||
subScalar(s: number): Vector2;
|
||||
subScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a - b.
|
||||
*/
|
||||
subVectors(a: Vector2, b: Vector2): Vector2;
|
||||
subVectors(a: Vector2, b: Vector2): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector by v.
|
||||
*/
|
||||
multiply(v: Vector2): Vector2;
|
||||
multiply(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector by scalar s.
|
||||
*/
|
||||
multiplyScalar(scalar: number): Vector2;
|
||||
multiplyScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Divides this vector by v.
|
||||
*/
|
||||
divide(v: Vector2): Vector2;
|
||||
divide(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* Divides this vector by scalar s.
|
||||
* Set vector to ( 0, 0 ) if s == 0.
|
||||
*/
|
||||
divideScalar(s: number): Vector2;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector (with an implicit 1 as the 3rd component) by m.
|
||||
*/
|
||||
applyMatrix3(m: Matrix3): Vector2;
|
||||
applyMatrix3(m: Matrix3): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding min value.
|
||||
*/
|
||||
min(v: Vector2): Vector2;
|
||||
min(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y value is less than v's x or y value, replace that value with the corresponding max value.
|
||||
*/
|
||||
max(v: Vector2): Vector2;
|
||||
max(v: Vector2): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value.
|
||||
@@ -4480,43 +4504,48 @@ export class Vector2 implements Vector {
|
||||
* @param min the minimum x and y values.
|
||||
* @param max the maximum x and y values in the desired range.
|
||||
*/
|
||||
clamp(min: Vector2, max: Vector2): Vector2;
|
||||
clamp(min: Vector2, max: Vector2): this;
|
||||
|
||||
/**
|
||||
* If this vector's x or y values are greater than the max value, they are replaced by the max value.
|
||||
* If this vector's x or y values are less than the min value, they are replaced by the min value.
|
||||
* @param min the minimum value the components will be clamped to.
|
||||
* @param max the maximum value the components will be clamped to.
|
||||
*/
|
||||
clampScalar(min: number, max: number): Vector2;
|
||||
clampScalar(min: number, max: number): this;
|
||||
|
||||
/**
|
||||
* If this vector's length is greater than the max value, it is replaced by the max value.
|
||||
* If this vector's length is less than the min value, it is replaced by the min value.
|
||||
* @param min the minimum value the length will be clamped to.
|
||||
* @param max the maximum value the length will be clamped to.
|
||||
*/
|
||||
clampLength(min: number, max: number): Vector2;
|
||||
clampLength(min: number, max: number): this;
|
||||
|
||||
/**
|
||||
* The components of the vector are rounded down to the nearest integer value.
|
||||
*/
|
||||
floor(): Vector2;
|
||||
floor(): this;
|
||||
|
||||
/**
|
||||
* The x and y components of the vector are rounded up to the nearest integer value.
|
||||
*/
|
||||
ceil(): Vector2;
|
||||
ceil(): this;
|
||||
|
||||
/**
|
||||
* The components of the vector are rounded to the nearest integer value.
|
||||
*/
|
||||
round(): Vector2;
|
||||
round(): this;
|
||||
|
||||
/**
|
||||
* The components of the vector are rounded towards zero (up if negative, down if positive) to an integer value.
|
||||
*/
|
||||
roundToZero(): Vector2;
|
||||
roundToZero(): this;
|
||||
|
||||
/**
|
||||
* Inverts this vector.
|
||||
*/
|
||||
negate(): Vector2;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* Computes dot product of this vector and v.
|
||||
@@ -4538,10 +4567,19 @@ export class Vector2 implements Vector {
|
||||
*/
|
||||
lengthManhattan(): number;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length of this vector.
|
||||
*
|
||||
* @return {number}
|
||||
*
|
||||
* @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
|
||||
*/
|
||||
manhattanLength(): number;
|
||||
|
||||
/**
|
||||
* Normalizes this vector.
|
||||
*/
|
||||
normalize(): Vector2;
|
||||
normalize(): this;
|
||||
|
||||
/**
|
||||
* computes the angle in radians with respect to the positive x-axis
|
||||
@@ -4552,33 +4590,47 @@ export class Vector2 implements Vector {
|
||||
* Computes distance of this vector to v.
|
||||
*/
|
||||
distanceTo(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* Computes squared distance of this vector to v.
|
||||
*/
|
||||
distanceToSquared(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector2#manhattanDistanceTo .manhattanDistanceTo()} instead.
|
||||
*/
|
||||
distanceToManhattan(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length (distance) from this vector to the given vector v
|
||||
*
|
||||
* @param {Vector2} v
|
||||
*
|
||||
* @return {number}
|
||||
*
|
||||
* @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
|
||||
*/
|
||||
manhattanDistanceTo(v: Vector2): number;
|
||||
|
||||
/**
|
||||
* Normalizes this vector and multiplies it by l.
|
||||
*/
|
||||
setLength(length: number): Vector2;
|
||||
setLength(length: number): this;
|
||||
|
||||
/**
|
||||
* Linearly interpolates between this vector and v, where alpha is the distance along the line - alpha = 0 will be this vector, and alpha = 1 will be v.
|
||||
* @param v vector to interpolate towards.
|
||||
* @param alpha interpolation factor in the closed interval [0, 1].
|
||||
*/
|
||||
lerp(v: Vector2, alpha: number): Vector2;
|
||||
lerp(v: Vector2, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to be the vector linearly interpolated between v1 and v2 where alpha is the distance along the line connecting the two vectors - alpha = 0 will be v1, and alpha = 1 will be v2.
|
||||
* @param v1 the starting vector.
|
||||
* @param v2 vector to interpolate towards.
|
||||
* @param alpha interpolation factor in the closed interval [0, 1].
|
||||
*/
|
||||
lerpVectors(v1: Vector2, v2: Vector2, alpha: number): Vector2;
|
||||
lerpVectors(v1: Vector2, v2: Vector2, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Checks for strict equality of this vector and v.
|
||||
@@ -4590,7 +4642,8 @@ export class Vector2 implements Vector {
|
||||
* @param array the source array.
|
||||
* @param offset (optional) offset into the array. Default is 0.
|
||||
*/
|
||||
fromArray(array: number[], offset?: number): Vector2;
|
||||
fromArray(array: number[], offset?: number): this;
|
||||
|
||||
/**
|
||||
* Returns an array [x, y], or copies x and y into the provided array.
|
||||
* @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
|
||||
@@ -4603,14 +4656,14 @@ export class Vector2 implements Vector {
|
||||
* @param attribute the source attribute.
|
||||
* @param index index in the attribute.
|
||||
*/
|
||||
fromBufferAttribute(attribute: BufferAttribute, index: number): Vector2;
|
||||
fromBufferAttribute(attribute: BufferAttribute, index: number): this;
|
||||
|
||||
/**
|
||||
* Rotates the vector around center by angle radians.
|
||||
* @param center the point around which to rotate.
|
||||
* @param angle the angle to rotate, in radians.
|
||||
*/
|
||||
rotateAround(center: Vector2, angle: number): Vector2;
|
||||
rotateAround(center: Vector2, angle: number): this;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length of this vector.
|
||||
@@ -4652,16 +4705,17 @@ export class Vector3 implements Vector {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
isVector3: true;
|
||||
|
||||
/**
|
||||
* Sets value of this vector.
|
||||
*/
|
||||
set(x: number, y: number, z: number): Vector3;
|
||||
set(x: number, y: number, z: number): this;
|
||||
|
||||
/**
|
||||
* Sets all values of this vector.
|
||||
*/
|
||||
setScalar(scalar: number): Vector3;
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets x value of this vector.
|
||||
@@ -4678,76 +4732,102 @@ export class Vector3 implements Vector {
|
||||
*/
|
||||
setZ(z: number): Vector3;
|
||||
|
||||
setComponent(index: number, value: number): void;
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
getComponent(index: number): number;
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector3;
|
||||
|
||||
/**
|
||||
* Copies value of v to this vector.
|
||||
*/
|
||||
copy(v: this): this;
|
||||
copy(v: Vector3): this;
|
||||
|
||||
/**
|
||||
* Adds v to this vector.
|
||||
*/
|
||||
add(a: Vector3): Vector3;
|
||||
addScalar(s: number): Vector3;
|
||||
addScaledVector(v: Vector3, s: number): Vector3;
|
||||
add(a: Vector3, b?: Vector3): this;
|
||||
|
||||
addScalar(s: number): this;
|
||||
|
||||
addScaledVector(v: Vector3, s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a + b.
|
||||
*/
|
||||
addVectors(a: Vector3, b: Vector3): Vector3;
|
||||
addVectors(a: Vector3, b: Vector3): this;
|
||||
|
||||
/**
|
||||
* Subtracts v from this vector.
|
||||
*/
|
||||
sub(a: Vector3): Vector3;
|
||||
sub(a: Vector3): this;
|
||||
|
||||
subScalar( s: number ): Vector3;
|
||||
subScalar( s: number ): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a - b.
|
||||
*/
|
||||
subVectors(a: Vector3, b: Vector3): Vector3;
|
||||
subVectors(a: Vector3, b: Vector3): this;
|
||||
|
||||
multiply(v: Vector3): this;
|
||||
|
||||
multiply(v: Vector3): Vector3;
|
||||
/**
|
||||
* Multiplies this vector by scalar s.
|
||||
*/
|
||||
multiplyScalar(s: number): Vector3;
|
||||
multiplyVectors(a: Vector3, b: Vector3): Vector3;
|
||||
applyEuler(euler: Euler): Vector3;
|
||||
applyAxisAngle(axis: Vector3, angle: number): Vector3;
|
||||
applyMatrix3(m: Matrix3): Vector3;
|
||||
applyMatrix4(m: Matrix4): Vector3;
|
||||
applyQuaternion(q: Quaternion): Vector3;
|
||||
project(camrea: Camera): Vector3;
|
||||
unproject(camera: Camera): Vector3;
|
||||
transformDirection(m: Matrix4): Vector3;
|
||||
divide(v: Vector3): Vector3;
|
||||
multiplyScalar(s: number): this;
|
||||
|
||||
multiplyVectors(a: Vector3, b: Vector3): this;
|
||||
|
||||
applyEuler(euler: Euler): this;
|
||||
|
||||
applyAxisAngle(axis: Vector3, angle: number): this;
|
||||
|
||||
applyMatrix3(m: Matrix3): this;
|
||||
|
||||
applyMatrix4(m: Matrix4): this;
|
||||
|
||||
applyQuaternion(q: Quaternion): this;
|
||||
|
||||
project(camrea: Camera): this;
|
||||
|
||||
unproject(camera: Camera): this;
|
||||
|
||||
transformDirection(m: Matrix4): this;
|
||||
|
||||
divide(v: Vector3): this;
|
||||
|
||||
|
||||
/**
|
||||
* Divides this vector by scalar s.
|
||||
* Set vector to ( 0, 0, 0 ) if s == 0.
|
||||
*/
|
||||
divideScalar(s: number): Vector3;
|
||||
min(v: Vector3): Vector3;
|
||||
max(v: Vector3): Vector3;
|
||||
clamp(min: Vector3, max: Vector3): Vector3;
|
||||
clampScalar(min: number, max: number): Vector3;
|
||||
clampLength(min: number, max: number): Vector3;
|
||||
floor(): Vector3;
|
||||
ceil(): Vector3;
|
||||
round(): Vector3;
|
||||
roundToZero(): Vector3;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
min(v: Vector3): this;
|
||||
|
||||
max(v: Vector3): this;
|
||||
|
||||
clamp(min: Vector3, max: Vector3): this;
|
||||
|
||||
clampScalar(min: number, max: number): this;
|
||||
|
||||
clampLength(min: number, max: number): this;
|
||||
|
||||
floor(): this;
|
||||
|
||||
ceil(): this;
|
||||
|
||||
round(): this;
|
||||
|
||||
roundToZero(): this;
|
||||
|
||||
/**
|
||||
* Inverts this vector.
|
||||
*/
|
||||
negate(): Vector3;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* Computes dot product of this vector and v.
|
||||
@@ -4795,28 +4875,28 @@ export class Vector3 implements Vector {
|
||||
/**
|
||||
* Normalizes this vector.
|
||||
*/
|
||||
normalize(): Vector3;
|
||||
normalize(): this;
|
||||
|
||||
/**
|
||||
* Normalizes this vector and multiplies it by l.
|
||||
*/
|
||||
setLength(l: number): Vector3;
|
||||
lerp(v: Vector3, alpha: number): Vector3;
|
||||
setLength(l: number): this;
|
||||
lerp(v: Vector3, alpha: number): this;
|
||||
|
||||
lerpVectors(v1: Vector3, v2: Vector3, alpha: number): Vector3;
|
||||
lerpVectors(v1: Vector3, v2: Vector3, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to cross product of itself and v.
|
||||
*/
|
||||
cross(a: Vector3): Vector3;
|
||||
cross(a: Vector3, w?: Vector3): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to cross product of a and b.
|
||||
*/
|
||||
crossVectors(a: Vector3, b: Vector3): Vector3;
|
||||
projectOnVector(v: Vector3): Vector3;
|
||||
projectOnPlane(planeNormal: Vector3): Vector3;
|
||||
reflect(vector: Vector3): Vector3;
|
||||
crossVectors(a: Vector3, b: Vector3): this;
|
||||
projectOnVector(v: Vector3): this;
|
||||
projectOnPlane(planeNormal: Vector3): this;
|
||||
reflect(vector: Vector3): this;
|
||||
angleTo(v: Vector3): number;
|
||||
|
||||
/**
|
||||
@@ -4834,10 +4914,11 @@ export class Vector3 implements Vector {
|
||||
*/
|
||||
distanceToManhattan(v: Vector3): number;
|
||||
|
||||
setFromSpherical(s: Spherical): Vector3;
|
||||
setFromMatrixPosition(m: Matrix4): Vector3;
|
||||
setFromMatrixScale(m: Matrix4): Vector3;
|
||||
setFromMatrixColumn(matrix: Matrix4, index: number): Vector3;
|
||||
setFromSpherical(s: Spherical): this;
|
||||
setFromCylindrical(s: Cylindrical): this;
|
||||
setFromMatrixPosition(m: Matrix4): this;
|
||||
setFromMatrixScale(m: Matrix4): this;
|
||||
setFromMatrixColumn(matrix: Matrix4, index: number): this;
|
||||
|
||||
/**
|
||||
* Checks for strict equality of this vector and v.
|
||||
@@ -4846,22 +4927,7 @@ export class Vector3 implements Vector {
|
||||
|
||||
fromArray(xyz: number[], offset?: number): Vector3;
|
||||
toArray(xyz?: number[], offset?: number): number[];
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector3;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector3#setFromMatrixPosition .setFromMatrixPosition()} instead.
|
||||
*/
|
||||
getPositionFromMatrix(m: Matrix4): Vector3;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector3#setFromMatrixScale .setFromMatrixScale()} instead.
|
||||
*/
|
||||
getScaleFromMatrix(m: Matrix4): Vector3;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector3#setFromMatrixColumn .setFromMatrixColumn()} instead.
|
||||
*/
|
||||
getColumnFromMatrix(index: number, matrix: Matrix4): Vector3;
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4881,43 +4947,47 @@ export class Vector4 implements Vector {
|
||||
y: number;
|
||||
z: number;
|
||||
w: number;
|
||||
isVector4: true;
|
||||
|
||||
/**
|
||||
* Sets value of this vector.
|
||||
*/
|
||||
set(x: number, y: number, z: number, w: number): Vector4;
|
||||
set(x: number, y: number, z: number, w: number): this;
|
||||
|
||||
/**
|
||||
* Sets all values of this vector.
|
||||
*/
|
||||
setScalar(scalar: number): Vector4;
|
||||
setScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets X component of this vector.
|
||||
*/
|
||||
setX(x: number): Vector4;
|
||||
setX(x: number): this;
|
||||
|
||||
/**
|
||||
* Sets Y component of this vector.
|
||||
*/
|
||||
setY(y: number): Vector4;
|
||||
setY(y: number): this;
|
||||
|
||||
/**
|
||||
* Sets Z component of this vector.
|
||||
*/
|
||||
setZ(z: number): Vector4;
|
||||
setZ(z: number): this;
|
||||
|
||||
/**
|
||||
* Sets w component of this vector.
|
||||
*/
|
||||
setW(w: number): Vector4;
|
||||
setW(w: number): this;
|
||||
|
||||
setComponent(index: number, value: number): this;
|
||||
|
||||
setComponent(index: number, value: number): void;
|
||||
getComponent(index: number): number;
|
||||
|
||||
/**
|
||||
* Clones this vector.
|
||||
*/
|
||||
clone(): this;
|
||||
clone(): Vector4;
|
||||
|
||||
/**
|
||||
* Copies value of v to this vector.
|
||||
*/
|
||||
@@ -4926,63 +4996,66 @@ export class Vector4 implements Vector {
|
||||
/**
|
||||
* Adds v to this vector.
|
||||
*/
|
||||
add(v: Vector4): Vector4;
|
||||
addScalar(s: number): Vector4;
|
||||
add(v: Vector4, w?: Vector4): this;
|
||||
|
||||
addScalar(scalar: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a + b.
|
||||
*/
|
||||
addVectors(a: Vector4, b: Vector4): Vector4;
|
||||
addScaledVector( v: Vector4, s: number ): Vector4;
|
||||
addVectors(a: Vector4, b: Vector4): this;
|
||||
|
||||
addScaledVector( v: Vector4, s: number ): this;
|
||||
/**
|
||||
* Subtracts v from this vector.
|
||||
*/
|
||||
sub(v: Vector4): Vector4;
|
||||
sub(v: Vector4): this;
|
||||
|
||||
subScalar(s: number): Vector4;
|
||||
subScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* Sets this vector to a - b.
|
||||
*/
|
||||
subVectors(a: Vector4, b: Vector4): Vector4;
|
||||
subVectors(a: Vector4, b: Vector4): this;
|
||||
|
||||
/**
|
||||
* Multiplies this vector by scalar s.
|
||||
*/
|
||||
multiplyScalar(s: number): Vector4;
|
||||
applyMatrix4(m: Matrix4): Vector4;
|
||||
multiplyScalar(s: number): this;
|
||||
|
||||
applyMatrix4(m: Matrix4): this;
|
||||
|
||||
/**
|
||||
* Divides this vector by scalar s.
|
||||
* Set vector to ( 0, 0, 0 ) if s == 0.
|
||||
*/
|
||||
divideScalar(s: number): Vector4;
|
||||
divideScalar(s: number): this;
|
||||
|
||||
/**
|
||||
* http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
|
||||
* @param q is assumed to be normalized
|
||||
*/
|
||||
setAxisAngleFromQuaternion(q: Quaternion): Vector4;
|
||||
setAxisAngleFromQuaternion(q: Quaternion): this;
|
||||
|
||||
/**
|
||||
* http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
|
||||
* @param m assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
|
||||
*/
|
||||
setAxisAngleFromRotationMatrix(m: Matrix3): Vector4;
|
||||
setAxisAngleFromRotationMatrix(m: Matrix3): this;
|
||||
|
||||
min(v: Vector4): Vector4;
|
||||
max(v: Vector4): Vector4;
|
||||
clamp(min: Vector4, max: Vector4): Vector4;
|
||||
clampScalar(min: number, max: number): Vector4;
|
||||
floor(): Vector4;
|
||||
ceil(): Vector4;
|
||||
round(): Vector4;
|
||||
roundToZero(): Vector4;
|
||||
min(v: Vector4): this;
|
||||
max(v: Vector4): this;
|
||||
clamp(min: Vector4, max: Vector4): this;
|
||||
clampScalar(min: number, max: number): this;
|
||||
floor(): this;
|
||||
ceil(): this;
|
||||
round(): this;
|
||||
roundToZero(): this;
|
||||
|
||||
/**
|
||||
* Inverts this vector.
|
||||
*/
|
||||
negate(): Vector4;
|
||||
negate(): this;
|
||||
|
||||
/**
|
||||
* Computes dot product of this vector and v.
|
||||
@@ -4999,11 +5072,6 @@ export class Vector4 implements Vector {
|
||||
*/
|
||||
length(): number;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Vector4#manhattanLength .manhattanLength()} instead.
|
||||
*/
|
||||
lengthManhattan(): number;
|
||||
|
||||
/**
|
||||
* Computes the Manhattan length of this vector.
|
||||
*
|
||||
@@ -5016,29 +5084,29 @@ export class Vector4 implements Vector {
|
||||
/**
|
||||
* Normalizes this vector.
|
||||
*/
|
||||
normalize(): Vector4;
|
||||
normalize(): this;
|
||||
/**
|
||||
* Normalizes this vector and multiplies it by l.
|
||||
*/
|
||||
setLength(length: number): Vector4;
|
||||
setLength(length: number): this;
|
||||
|
||||
/**
|
||||
* Linearly interpolate between this vector and v with alpha factor.
|
||||
*/
|
||||
lerp(v: Vector4, alpha: number): Vector4;
|
||||
lerp(v: Vector4, alpha: number): this;
|
||||
|
||||
lerpVectors(v1: Vector4, v2: Vector4, alpha: number): Vector4;
|
||||
lerpVectors(v1: Vector4, v2: Vector4, alpha: number): this;
|
||||
|
||||
/**
|
||||
* Checks for strict equality of this vector and v.
|
||||
*/
|
||||
equals(v: Vector4): boolean;
|
||||
|
||||
fromArray(xyzw: number[], offset?: number): Vector4;
|
||||
fromArray(xyzw: number[], offset?: number): this;
|
||||
|
||||
toArray(xyzw?: number[], offset?: number): number[];
|
||||
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector4;
|
||||
fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): this;
|
||||
}
|
||||
|
||||
export abstract class Interpolant {
|
||||
@@ -6092,12 +6160,12 @@ export class WebGLLights {
|
||||
get(light: any): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object with a series of statistical information about the graphics board memory and the rendering process.
|
||||
*/
|
||||
/**
|
||||
* An object with a series of statistical information about the graphics board memory and the rendering process.
|
||||
*/
|
||||
export class WebGLInfo {
|
||||
autoReset: boolean;
|
||||
memory: {
|
||||
memory: {
|
||||
geometries: number;
|
||||
textures: number;
|
||||
};
|
||||
@@ -6678,14 +6746,14 @@ export class AudioListener extends Object3D {
|
||||
* class Curve<T extends Vector>
|
||||
*/
|
||||
export class Curve<T extends Vector> {
|
||||
|
||||
|
||||
/**
|
||||
* This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
|
||||
* To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large.
|
||||
* This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
|
||||
* To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large.
|
||||
* Default is 200.
|
||||
*/
|
||||
arcLengthDivisions:number;
|
||||
|
||||
|
||||
/**
|
||||
* Returns a vector for point t of the curve where t is between 0 and 1
|
||||
* getPoint(t: number): T;
|
||||
|
||||
3
types/three/three-effectcomposer.d.ts
vendored
3
types/three/three-effectcomposer.d.ts
vendored
@@ -8,7 +8,7 @@ export class EffectComposer {
|
||||
renderTarget2: WebGLRenderTarget;
|
||||
writeBuffer: WebGLRenderTarget;
|
||||
readBuffer: WebGLRenderTarget;
|
||||
passes: any[];
|
||||
passes: Pass[];
|
||||
copyPass: ShaderPass;
|
||||
|
||||
swapBuffers(): void;
|
||||
@@ -41,5 +41,4 @@ export class Pass{
|
||||
setSize(width: number, height:number ): void;
|
||||
|
||||
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number, maskActive?: boolean): void;
|
||||
|
||||
}
|
||||
10
types/three/three-filmpass.d.ts
vendored
10
types/three/three-filmpass.d.ts
vendored
@@ -1,13 +1,13 @@
|
||||
import { Camera, Scene, WebGLRenderTarget, WebGLRenderer, Material, Mesh, IUniform } from "./three-core";
|
||||
import { OrthographicCamera, Scene, WebGLRenderTarget, WebGLRenderer, ShaderMaterial, Mesh, IUniform } from "./three-core";
|
||||
import {Pass} from "./three-effectcomposer";
|
||||
|
||||
export class FilmPass extends Pass {
|
||||
constructor(noiseIntensity: number, scanlinesIntensity: number, scanlinesCount: number, grayscale: boolean);
|
||||
constructor(noiseIntensity?: number, scanlinesIntensity?: number, scanlinesCount?: number, grayscale?: boolean);
|
||||
|
||||
scene: Scene;
|
||||
camera: Camera;
|
||||
uniforms: IUniform;
|
||||
material: Material;
|
||||
camera: OrthographicCamera;
|
||||
uniforms: { [uniform: string]: IUniform };
|
||||
material: ShaderMaterial;
|
||||
quad: Mesh;
|
||||
|
||||
}
|
||||
|
||||
19
types/three/three-maskpass.d.ts
vendored
19
types/three/three-maskpass.d.ts
vendored
@@ -1,22 +1,15 @@
|
||||
import { Camera, Scene, WebGLRenderTarget, WebGLRenderer } from "./three-core";
|
||||
import { Pass } from "./three-effectcomposer";
|
||||
|
||||
export class MaskPass {
|
||||
export class MaskPass extends Pass {
|
||||
constructor(scene: Scene, camera: Camera);
|
||||
|
||||
scene: Scene;
|
||||
camera: Camera;
|
||||
enabled: boolean;
|
||||
clear: boolean;
|
||||
needsSwap: boolean;
|
||||
clear: true;
|
||||
needsSwap: false;
|
||||
inverse: boolean;
|
||||
|
||||
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
|
||||
}
|
||||
|
||||
export class ClearMaskPass {
|
||||
constructor();
|
||||
|
||||
enabled: boolean;
|
||||
|
||||
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
|
||||
export class ClearMaskPass extends Pass {
|
||||
needsSwap: false;
|
||||
}
|
||||
|
||||
31
types/three/three-outlinepass.d.ts
vendored
31
types/three/three-outlinepass.d.ts
vendored
@@ -1,9 +1,11 @@
|
||||
import { Camera, Color, Object3D, Scene, Vector2 } from './three-core';
|
||||
import { Camera, Color, Object3D, Scene, Vector2, MeshBasicMaterial, ShaderMaterial, WebGLRenderTarget, IUniform, Matrix4 } from './three-core';
|
||||
import {Pass} from "./three-effectcomposer";
|
||||
|
||||
export class OutlinePass {
|
||||
constructor(size: Vector2, scene: Scene, camer: Camera, selectedObjects?: Array<Object3D>);
|
||||
selectedObjects: Array<Object3D>;
|
||||
export class OutlinePass extends Pass {
|
||||
constructor(resolution: Vector2, scene: Scene, camera: Camera, selectedObjects?: Object3D[]);
|
||||
selectedObjects: Object3D[];
|
||||
renderCamera: Camera;
|
||||
renderScene: Scene;
|
||||
visibleEdgeColor: Color;
|
||||
hiddenEdgeColor: Color;
|
||||
edgeGlow: number;
|
||||
@@ -13,5 +15,26 @@ export class OutlinePass {
|
||||
downSampleRatio: number;
|
||||
pulsePeriod: number;
|
||||
resolution: Vector2;
|
||||
maskBufferMaterial: MeshBasicMaterial;
|
||||
prepareMaskMaterial: ShaderMaterial;
|
||||
renderTargetDepthBuffer: WebGLRenderTarget;
|
||||
renderTargetMaskDownSampleBuffer: WebGLRenderTarget;
|
||||
renderTargetBlurBuffer1: WebGLRenderTarget;
|
||||
renderTargetBlurBuffer2: WebGLRenderTarget;
|
||||
edgeDetectionMaterial: ShaderMaterial;
|
||||
separableBlurMaterial: ShaderMaterial;
|
||||
overlayMaterial: ShaderMaterial;
|
||||
copyUniforms: { [uniform: string]: IUniform };
|
||||
materialCopy: ShaderMaterial;
|
||||
oldClearColor: Color;
|
||||
tempPulseColor1: Color;
|
||||
tempPulseColor2: Color;
|
||||
textureMatrix: Matrix4;
|
||||
static BlurDirectionX: Vector2;
|
||||
static BlurDirectionY: Vector2;
|
||||
dispose(): void;
|
||||
changeVisibilityOfSelectedObjects(bVisible: boolean): void;
|
||||
changeVisibilityOfNonSelectedObjects(bVisible: boolean): void;
|
||||
updateTextureMatrix(): void;
|
||||
}
|
||||
|
||||
|
||||
19
types/three/three-renderpass.d.ts
vendored
19
types/three/three-renderpass.d.ts
vendored
@@ -6,20 +6,17 @@ import {
|
||||
WebGLRenderTarget,
|
||||
WebGLRenderer
|
||||
} from "./three-core";
|
||||
import { Pass } from "./three-effectcomposer";
|
||||
|
||||
export class RenderPass {
|
||||
constructor(scene: Scene, camera: Camera, overrideMaterial?: Material, clearColor?: Color | string | number, clearAlpha?: number);
|
||||
export class RenderPass extends Pass{
|
||||
constructor(scene: Scene, camera: Camera, overrideMaterial?: Material | null, clearColor?: Color | string | number, clearAlpha?: number);
|
||||
|
||||
scene: Scene;
|
||||
camera: Camera;
|
||||
overrideMaterial: Material;
|
||||
clearColor: Color | string | number;
|
||||
clearAlpha: number;
|
||||
oldClearColor: Color;
|
||||
oldClearAlpha: number;
|
||||
enabled: boolean;
|
||||
overrideMaterial: Material | null | undefined;
|
||||
clearColor: Color | string | number | undefined;
|
||||
clearAlpha: number | undefined;
|
||||
clear: boolean;
|
||||
needsSwap: boolean;
|
||||
|
||||
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
|
||||
needsSwap: false;
|
||||
clearDepth: false;
|
||||
}
|
||||
|
||||
16
types/three/three-shaderpass.d.ts
vendored
16
types/three/three-shaderpass.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
Camera,
|
||||
OrthographicCamera,
|
||||
IUniform,
|
||||
Mesh,
|
||||
Scene,
|
||||
Shader,
|
||||
@@ -7,20 +8,15 @@ import {
|
||||
WebGLRenderTarget,
|
||||
WebGLRenderer
|
||||
} from "./three-core";
|
||||
import { Pass } from "./three-effectcomposer";
|
||||
|
||||
export class ShaderPass {
|
||||
export class ShaderPass extends Pass {
|
||||
constructor(shader: Shader, textureID?: string);
|
||||
|
||||
textureID: string;
|
||||
uniforms: any;
|
||||
uniforms: { [uniform: string]: IUniform };
|
||||
material: ShaderMaterial;
|
||||
renderToScreen: boolean;
|
||||
enabled: boolean;
|
||||
needsSwap: boolean;
|
||||
clear: boolean;
|
||||
camera: Camera;
|
||||
camera: OrthographicCamera;
|
||||
scene: Scene;
|
||||
quad: Mesh;
|
||||
|
||||
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
|
||||
}
|
||||
23
types/three/three-smaapass.d.ts
vendored
23
types/three/three-smaapass.d.ts
vendored
@@ -1,5 +1,24 @@
|
||||
export class SMAAPass {
|
||||
import { WebGLRenderTarget, Texture, IUniform, ShaderMaterial, OrthographicCamera, Scene, Mesh } from "./three-core";
|
||||
import { Pass } from "./three-effectcomposer";
|
||||
|
||||
export class SMAAPass extends Pass {
|
||||
constructor(width: number, height: number);
|
||||
renderToScreen: boolean;
|
||||
edgesRT: WebGLRenderTarget;
|
||||
weightsRT: WebGLRenderTarget;
|
||||
areaTexture: Texture;
|
||||
searchTexture: Texture;
|
||||
uniformsEdges: { [uniform: string]: IUniform };
|
||||
materialEdges: ShaderMaterial;
|
||||
uniformsWeights: { [uniform: string]: IUniform };
|
||||
materialWeights: ShaderMaterial;
|
||||
uniformsBlend: { [uniform: string]: IUniform };
|
||||
materialBlend: ShaderMaterial;
|
||||
needsSwap: false;
|
||||
camera: OrthographicCamera;
|
||||
scene: Scene;
|
||||
quad: Mesh;
|
||||
|
||||
getAreaTexture(): string;
|
||||
getSearchTexture(): string;
|
||||
}
|
||||
|
||||
|
||||
19
types/three/three-ssaapass.d.ts
vendored
Normal file
19
types/three/three-ssaapass.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Pass } from "./three-effectcomposer";
|
||||
import { Scene, Camera, Color, IUniform, ShaderMaterial, OrthographicCamera, Mesh } from "./three-core";
|
||||
|
||||
export class SSAARenderPass extends Pass {
|
||||
constructor(scene: Scene, camera: Camera, clearColor?: Color | string | number, clearAlpha?: number);
|
||||
scene: Scene;
|
||||
camera: Camera;
|
||||
sampleLevel: number;
|
||||
unbiased: boolean;
|
||||
clearColor: Color | string | number;
|
||||
clearAlpha: number;
|
||||
copyUniforms: { [uniform: string]: IUniform };
|
||||
copyMaterial: ShaderMaterial;
|
||||
camera2: OrthographicCamera;
|
||||
scene2: Scene;
|
||||
quad2: Mesh;
|
||||
dispose(): void;
|
||||
static readonly JitterVectors: number[][][];
|
||||
}
|
||||
30
types/three/three-unrealbloompass.d.ts
vendored
Normal file
30
types/three/three-unrealbloompass.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Pass } from "./three-effectcomposer";
|
||||
import { Vector2, ShaderMaterial, WebGLRenderTarget, IUniform, Color, Scene, Mesh, OrthographicCamera } from "./three-core";
|
||||
|
||||
export class UnrealBloomPass extends Pass {
|
||||
constructor(resolution?: Vector2, strength?: number, radius?: number, threshold?: number);
|
||||
strength: number;
|
||||
resolution: Vector2;
|
||||
nMips: number;
|
||||
renderTargetBright: WebGLRenderTarget;
|
||||
highPassUniforms: { [uniform: string]: IUniform };
|
||||
renderTargetsHorizontal: WebGLRenderTarget[];
|
||||
renderTargetsVertical: WebGLRenderTarget[];
|
||||
materialHighPassFilter: ShaderMaterial;
|
||||
separableBlurMaterials: ShaderMaterial[];
|
||||
compositeMaterial: ShaderMaterial;
|
||||
bloomTintColors: Color[];
|
||||
copyUniforms: { [uniform: string]: IUniform };
|
||||
materialCopy: ShaderMaterial;
|
||||
needsSwap: false;
|
||||
oldClearAlpha: number;
|
||||
oldClearColor: Color;
|
||||
camera: OrthographicCamera;
|
||||
scene: Scene;
|
||||
quad: Mesh;
|
||||
dispose(): void;
|
||||
getSeparableBlurMaterial(): ShaderMaterial;
|
||||
getCompositeMaterial(): ShaderMaterial;
|
||||
static BlurDirectionX: Vector2;
|
||||
static BlurDirectionY: Vector2;
|
||||
}
|
||||
Reference in New Issue
Block a user