mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
Merge remote-tracking branch 'dt/master'
This commit is contained in:
+1
-1
@@ -5,5 +5,5 @@ indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.json,*.yml}]
|
||||
[{*.json,*.yml,*.ts}]
|
||||
indent_style = space
|
||||
|
||||
+4952
-4869
File diff suppressed because it is too large
Load Diff
@@ -174,6 +174,12 @@
|
||||
"sourceRepoURL": "https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions",
|
||||
"asOfVersion": "2.0.15"
|
||||
},
|
||||
{
|
||||
"libraryName": "bitwise",
|
||||
"typingsPackageName": "bitwise",
|
||||
"sourceRepoURL": "https://github.com/dodekeract/bitwise",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "botvs",
|
||||
"typingsPackageName": "botvs",
|
||||
@@ -978,6 +984,12 @@
|
||||
"sourceRepoURL": "https://github.com/mqttjs/MQTT.js",
|
||||
"asOfVersion": "2.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "nano",
|
||||
"typingsPackageName": "nano",
|
||||
"sourceRepoURL": "https://github.com/apache/couchdb-nano",
|
||||
"asOfVersion": "7.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "ng-table",
|
||||
"typingsPackageName": "ng-table",
|
||||
@@ -1272,6 +1284,12 @@
|
||||
"sourceRepoURL": "https://github.com/zalmoxisus/redux-devtools-extension",
|
||||
"asOfVersion": "2.13.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-little-router",
|
||||
"typingsPackageName": "redux-little-router",
|
||||
"sourceRepoURL": "https://github.com/FormidableLabs/redux-little-router",
|
||||
"asOfVersion": "15.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-persist",
|
||||
"typingsPackageName": "redux-persist",
|
||||
|
||||
Vendored
-16
@@ -1,16 +0,0 @@
|
||||
// Type definitions for react-table-filter 1.0.0
|
||||
// Project: https://github.com/cheekujha/react-table-filter
|
||||
// Definitions by: Gnanavel N <https://github.com/gjsln/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface TabfilterProps {
|
||||
rows: string | Array<string> | { [name: string]: boolean; };
|
||||
onFilterUpdate: (filteredArray: Array<string>, currentFilters: any[]) => any[] | void;
|
||||
rowClass?: string;
|
||||
initialFilters?: string | Array<string> | { [name: string]: boolean; };
|
||||
}
|
||||
|
||||
export declare class TableFilter extends React.Component<TabfilterProps> {}
|
||||
@@ -11,3 +11,7 @@ const test = (levelDown: AbstractLevelDOWN<any, string>) => {
|
||||
test(new AbstractLevelDOWN('here'));
|
||||
// $ExpectType void
|
||||
test(AbstractLevelDOWN('there'));
|
||||
// $ExpectType void
|
||||
test(new AbstractLevelDOWN<any, string>('here'));
|
||||
// $ExpectType void
|
||||
test(AbstractLevelDOWN<any, string>('there'));
|
||||
|
||||
Vendored
+25
-14
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Meirion Hughes <https://github.com/MeirionHughes>
|
||||
// Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export interface AbstractOptions {
|
||||
readonly [k: string]: any;
|
||||
@@ -21,7 +22,7 @@ export interface AbstractGetOptions extends AbstractOptions {
|
||||
asBuffer?: boolean;
|
||||
}
|
||||
|
||||
export interface AbstractLevelDOWN<K, V> extends AbstractOptions {
|
||||
export interface AbstractLevelDOWN<K = any, V = any> extends AbstractOptions {
|
||||
open(cb: ErrorCallback): void;
|
||||
open(options: AbstractOpenOptions, cb: ErrorCallback): void;
|
||||
|
||||
@@ -38,17 +39,23 @@ export interface AbstractLevelDOWN<K, V> extends AbstractOptions {
|
||||
|
||||
batch(): AbstractChainedBatch<K, V>;
|
||||
batch(array: ReadonlyArray<AbstractBatch<K, V>>, cb: ErrorCallback): AbstractChainedBatch<K, V>;
|
||||
batch(array: ReadonlyArray<AbstractBatch<K, V>>, options: AbstractOptions, cb: ErrorCallback): AbstractChainedBatch<K, V>;
|
||||
batch(
|
||||
array: ReadonlyArray<AbstractBatch<K, V>>,
|
||||
options: AbstractOptions,
|
||||
cb: ErrorCallback,
|
||||
): AbstractChainedBatch<K, V>;
|
||||
|
||||
iterator(options?: AbstractIteratorOptions<K>): AbstractIterator<K, V>;
|
||||
}
|
||||
|
||||
export interface AbstractLevelDOWNConstructor {
|
||||
new (location: string): AbstractLevelDOWN<any, any>;
|
||||
(location: string): AbstractLevelDOWN<any, any>;
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
new <K = any, V = any>(location: string): AbstractLevelDOWN<K, V>;
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
<K = any, V = any>(location: string): AbstractLevelDOWN<K, V>;
|
||||
}
|
||||
|
||||
export interface AbstractIteratorOptions<K> extends AbstractOptions {
|
||||
export interface AbstractIteratorOptions<K = any> extends AbstractOptions {
|
||||
gt?: K;
|
||||
gte?: K;
|
||||
lt?: K;
|
||||
@@ -61,20 +68,20 @@ export interface AbstractIteratorOptions<K> extends AbstractOptions {
|
||||
valueAsBuffer?: boolean;
|
||||
}
|
||||
|
||||
export type AbstractBatch<K, V> = PutBatch<K, V> | DelBatch<K, V>;
|
||||
export type AbstractBatch<K = any, V = any> = PutBatch<K, V> | DelBatch<K, V>;
|
||||
|
||||
export interface PutBatch<K, V> {
|
||||
export interface PutBatch<K = any, V = any> {
|
||||
readonly type: 'put';
|
||||
readonly key: K;
|
||||
readonly value: V;
|
||||
}
|
||||
|
||||
export interface DelBatch<K, V> {
|
||||
export interface DelBatch<K = any, V = any> {
|
||||
readonly type: 'del';
|
||||
readonly key: K;
|
||||
}
|
||||
|
||||
export interface AbstractChainedBatch<K, V> extends AbstractChainedBatchConstructor, AbstractOptions {
|
||||
export interface AbstractChainedBatch<K = any, V = any> extends AbstractOptions {
|
||||
put: (key: K, value: V) => this;
|
||||
del: (key: K) => this;
|
||||
clear: () => this;
|
||||
@@ -83,19 +90,23 @@ export interface AbstractChainedBatch<K, V> extends AbstractChainedBatchConstruc
|
||||
}
|
||||
|
||||
export interface AbstractChainedBatchConstructor {
|
||||
new(db: any): AbstractChainedBatch<any, any>;
|
||||
(db: any): AbstractChainedBatch<any, any>;
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
new <K = any, V = any>(db: any): AbstractChainedBatch<K, V>;
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
<K = any, V = any>(db: any): AbstractChainedBatch<K, V>;
|
||||
}
|
||||
|
||||
export interface AbstractIterator<K, V> extends AbstractChainedBatchConstructor {
|
||||
export interface AbstractIterator<K, V> extends AbstractOptions {
|
||||
db: AbstractLevelDOWN<K, V>;
|
||||
next(cb: ErrorKeyValueCallback<K, V>): this;
|
||||
end(cb: ErrorCallback): void;
|
||||
}
|
||||
|
||||
export interface AbstractIteratorConstructor {
|
||||
new(db: any): AbstractIterator<any, any>;
|
||||
(db: any): AbstractIterator<any, any>;
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
new <K = any, V = any>(db: any): AbstractIterator<K, V>;
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
<K = any, V = any>(db: any): AbstractIterator<K, V>;
|
||||
}
|
||||
|
||||
export const AbstractLevelDOWN: AbstractLevelDOWNConstructor;
|
||||
|
||||
Vendored
+437
-306
@@ -1,345 +1,476 @@
|
||||
// Type definitions for AFRAME 0.7
|
||||
// Type definitions for AFRAME 0.8
|
||||
// Project: https://aframe.io/
|
||||
// Definitions by: Paul Shannon <https://github.com/devpaul>
|
||||
// Roberto Ritger <https://github.com/bertoritger>
|
||||
// Trygve Wastvedt <https://github.com/twastvedt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/**
|
||||
* Extended tests available at https://github.com/devpaul/aframe-typings.git
|
||||
* Extended tests and examples available at https://github.com/devpaul/aframe-experiments.git
|
||||
*/
|
||||
|
||||
/// <reference types="three" />
|
||||
/// <reference types="tween.js" />
|
||||
|
||||
// Globals
|
||||
declare var AFRAME: AFrame.AFrameGlobal;
|
||||
declare var hasNativeWebVRImplementation: boolean;
|
||||
import * as three from 'three';
|
||||
import * as tween from '@tweenjs/tween.js';
|
||||
|
||||
interface Document {
|
||||
createElement(tagName: string): AFrame.Entity;
|
||||
querySelector(selectors: 'a-scene'): AFrame.Scene;
|
||||
querySelector(selectors: string): AFrame.Entity<any>;
|
||||
querySelectorAll(selectors: string): NodeListOf<AFrame.Entity<any> | Element>;
|
||||
export type ThreeLib = typeof three;
|
||||
export type TweenLib = typeof tween;
|
||||
|
||||
export interface ObjectMap<T = any> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
// Interfaces
|
||||
declare namespace AFrame {
|
||||
interface ObjectMap<T = any> {
|
||||
[ key: string ]: T;
|
||||
}
|
||||
export interface Animation {
|
||||
attribute: string;
|
||||
begin: string | number;
|
||||
delay: number;
|
||||
direction: 'alternate' | 'alternateReverse' | 'normal' | 'reverse';
|
||||
dur: number;
|
||||
easing(): void;
|
||||
end: string;
|
||||
fill: 'backwards' | 'both' | 'forwards' | 'none';
|
||||
from: any; // TODO type
|
||||
repeat: number | 'indefinite';
|
||||
to: number;
|
||||
}
|
||||
|
||||
interface AFrameGlobal {
|
||||
AEntity: Entity;
|
||||
ANode: ANode;
|
||||
AScene: Scene;
|
||||
components: { [ key: string ]: ComponentDescriptor };
|
||||
geometries: { [ key: string ]: GeometryDescriptor };
|
||||
primitives: { [ key: string ]: Entity };
|
||||
registerComponent<T extends Component>(name: string, component: ComponentDefinition<T>): ComponentConstructor<T>;
|
||||
registerElement(name: string, element: ANode): void;
|
||||
registerGeometry<T extends Geometry>(name: string, geometry: GeometryDefinition<T>): GeometryConstructor<T>;
|
||||
registerPrimitive(name: string, primitive: PrimitiveDefinition): void;
|
||||
registerShader<T extends Shader>(name: string, shader: T): ShaderConstructor<T>;
|
||||
registerSystem<T extends System>(name: string, definition: SystemDefinition<T>): SystemConstructor<T>;
|
||||
schema: SchemaUtils;
|
||||
shaders: { [ key: string ]: ShaderDescriptor };
|
||||
systems: { [key: string]: SystemConstructor };
|
||||
THREE: typeof THREE;
|
||||
TWEEN: typeof TWEEN;
|
||||
utils: Utils;
|
||||
version: string;
|
||||
}
|
||||
export interface ANode extends HTMLElement {
|
||||
// Only public APIs added. Many methods intentionally left out.
|
||||
// createdCallback
|
||||
// attachedCallback
|
||||
// attributeChangedCallback
|
||||
closestScene(): Scene;
|
||||
closest(selector: string): ANode;
|
||||
// detachedCallback
|
||||
hasLoaded: boolean;
|
||||
load(cb?: () => void, childFilter?: (el: Element) => boolean): void;
|
||||
// updateMixins
|
||||
registerMixin(id: string): void;
|
||||
setAttribute(type: string, newValue: any): void;
|
||||
unregisterMixin(id: string): void;
|
||||
removeMixinListener(id: string): void;
|
||||
attachMixinListener(mixin: HTMLElement): void;
|
||||
emit(name: string, detail?: any, bubbles?: boolean): void;
|
||||
emitter(name: string, detail?: any, bubbles?: boolean): () => void;
|
||||
}
|
||||
|
||||
interface Animation {
|
||||
attribute: string;
|
||||
begin: string | number;
|
||||
delay: number;
|
||||
direction: 'alternate' | 'alternateReverse' | 'normal' | 'reverse';
|
||||
dur: number;
|
||||
easing(): void;
|
||||
end: string;
|
||||
fill: 'backwards' | 'both' | 'forwards' | 'none';
|
||||
from: any; // TODO type
|
||||
repeat: number | 'indefinite';
|
||||
to: number;
|
||||
}
|
||||
export interface Behavior {
|
||||
tick(): void;
|
||||
}
|
||||
|
||||
interface ANode extends HTMLElement {
|
||||
// Only public APIs added. Many methods intentionally left out.
|
||||
// createdCallback
|
||||
// attachedCallback
|
||||
// attributeChangedCallback
|
||||
closestScene(): Scene;
|
||||
closest(selector: string): ANode;
|
||||
// detachedCallback
|
||||
hasLoaded: boolean;
|
||||
load(cb?: () => void, childFilter?: (el: Element) => boolean): void;
|
||||
// updateMixins
|
||||
registerMixin(id: string): void;
|
||||
setAttribute(type: string, newValue: any): void;
|
||||
unregisterMixin(id: string): void;
|
||||
removeMixinListener(id: string): void;
|
||||
attachMixinListener(mixin: HTMLElement): void;
|
||||
emit(name: string, detail?: any, bubbles?: boolean): void;
|
||||
emitter(name: string, detail?: any, bubbles?: boolean): () => void;
|
||||
}
|
||||
export interface Component<T extends object = any, S extends System = System> {
|
||||
attrName?: string;
|
||||
data: T;
|
||||
dependencies?: string[];
|
||||
el: Entity;
|
||||
id: string;
|
||||
multiple?: boolean;
|
||||
name: string;
|
||||
schema: Schema<T>;
|
||||
system: S | undefined;
|
||||
|
||||
interface Behavior {
|
||||
tick(): void;
|
||||
}
|
||||
init(data?: T): void;
|
||||
pause(): void;
|
||||
play(): void;
|
||||
remove(): void;
|
||||
tick?(time: number, timeDelta: number): void;
|
||||
update(oldData: T): void;
|
||||
updateSchema?(): void;
|
||||
|
||||
interface Component<T extends { [key: string]: any } = any, S extends System = System> {
|
||||
attrName?: string;
|
||||
data: T;
|
||||
dependencies?: string[];
|
||||
el: Entity;
|
||||
id: string;
|
||||
multiple?: boolean;
|
||||
extendSchema(update: Schema): void;
|
||||
flushToDOM(): void;
|
||||
}
|
||||
|
||||
export interface ComponentConstructor<T extends object> {
|
||||
new (el: Entity, attrValue: string, id: string): T & Component;
|
||||
prototype: T & {
|
||||
name: string;
|
||||
schema: Schema<T>;
|
||||
system: S | undefined;
|
||||
|
||||
init(this: this, data?: T): void;
|
||||
pause(this: this): void;
|
||||
play(this: this): void;
|
||||
remove(this: this): void;
|
||||
tick?(this: this, time: number, timeDelta: number): void;
|
||||
update(this: this, oldData: T): void;
|
||||
updateSchema?(this: this): void;
|
||||
|
||||
extendSchema(this: this, update: Schema): void;
|
||||
flushToDOM(this: this): void;
|
||||
}
|
||||
|
||||
interface ComponentConstructor<T extends Component> {
|
||||
new (el: Entity, attrValue: string, id: string): T;
|
||||
}
|
||||
|
||||
type ComponentDefinition<T extends Component = Component> = Partial<T>;
|
||||
|
||||
interface ComponentDescriptor<T extends Component = Component> {
|
||||
Component: ComponentConstructor<T>;
|
||||
dependencies: string[] | undefined;
|
||||
multiple: boolean | undefined;
|
||||
|
||||
// internal APIs2
|
||||
// parse
|
||||
// parseAttrValueForCache
|
||||
// schema
|
||||
// stringify
|
||||
// type
|
||||
}
|
||||
|
||||
interface Coordinate {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
interface DefaultComponents {
|
||||
position: Component<Coordinate>;
|
||||
rotation: Component<Coordinate>;
|
||||
scale: Component<Coordinate>;
|
||||
}
|
||||
|
||||
interface Entity<C = ObjectMap<Component>> extends ANode {
|
||||
components: C & DefaultComponents;
|
||||
isPlaying: boolean;
|
||||
object3D: THREE.Object3D;
|
||||
object3DMap: ObjectMap<THREE.Object3D>;
|
||||
sceneEl?: Scene;
|
||||
|
||||
addState(name: string): void;
|
||||
flushToDOM(recursive?: boolean): void;
|
||||
/**
|
||||
* @deprecated since 0.4.0
|
||||
*/
|
||||
getComputedAttribute(attr: string): Component;
|
||||
getDOMAttribute(attr: string): any;
|
||||
getObject3D(type: string): THREE.Object3D;
|
||||
getOrCreateObject3D(type: string, construct: any): THREE.Object3D;
|
||||
is(stateName: string): boolean;
|
||||
pause(): void;
|
||||
system: System;
|
||||
play(): void;
|
||||
setObject3D(type: string, obj: THREE.Object3D): void;
|
||||
removeAttribute(attr: string, property?: string): void;
|
||||
removeObject3D(type: string): void;
|
||||
removeState(stateName: string): void;
|
||||
|
||||
// getAttribute specific usages
|
||||
getAttribute(type: string): any;
|
||||
getAttribute(type: 'position' | 'rotation' | 'scale'): Coordinate;
|
||||
|
||||
// setAttribute specific usages
|
||||
setAttribute(attr: string, value: any): void;
|
||||
setAttribute(attr: string, property: string, componentAttrValue?: any): void;
|
||||
setAttribute(type: 'position' | 'rotation' | 'scale', value: Coordinate): void;
|
||||
|
||||
// addEventListener specific usages
|
||||
addEventListener<K extends keyof EntityEventMap>(type: K, listener: (event: Event & EntityEventMap[K]) => void, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
type DetailEvent<D> = Event & {
|
||||
detail: D;
|
||||
target: EventTarget & Entity;
|
||||
pause(): void;
|
||||
};
|
||||
}
|
||||
|
||||
interface EntityEventMap {
|
||||
'child-attached': DetailEvent<{ el: Element | Entity }>;
|
||||
'child-detached': DetailEvent<{ el: Element | Entity }>;
|
||||
'componentchanged': DetailEvent<{
|
||||
name: string,
|
||||
id: string
|
||||
}>;
|
||||
'componentremoved': DetailEvent<{
|
||||
name: string,
|
||||
id: string,
|
||||
newData: any,
|
||||
oldData: any
|
||||
}>;
|
||||
'loaded': EventListener;
|
||||
'pause': EventListener;
|
||||
'play': EventListener;
|
||||
'stateadded': DetailEvent<{ state: string }>;
|
||||
'stateremoved': DetailEvent<{ state: string }>;
|
||||
'schemachanged': DetailEvent<{ componentName: string }>;
|
||||
}
|
||||
export interface ComponentDescriptor<T extends Component = Component> {
|
||||
Component: ComponentConstructor<T>;
|
||||
dependencies: string[] | undefined;
|
||||
multiple: boolean | undefined;
|
||||
|
||||
interface Geometry {
|
||||
// internal APIs2
|
||||
// parse
|
||||
// parseAttrValueForCache
|
||||
// schema
|
||||
// stringify
|
||||
// type
|
||||
}
|
||||
|
||||
export interface Coordinate {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
|
||||
export interface DefaultComponents {
|
||||
position: Component<Coordinate>;
|
||||
rotation: Component<Coordinate>;
|
||||
scale: Component<Coordinate>;
|
||||
}
|
||||
|
||||
export interface Entity<C = ObjectMap<Component>> extends ANode {
|
||||
components: C & DefaultComponents;
|
||||
isPlaying: boolean;
|
||||
object3D: THREE.Object3D;
|
||||
object3DMap: ObjectMap<THREE.Object3D>;
|
||||
sceneEl?: Scene;
|
||||
|
||||
addState(name: string): void;
|
||||
flushToDOM(recursive?: boolean): void;
|
||||
/**
|
||||
* @deprecated since 0.4.0
|
||||
*/
|
||||
getComputedAttribute(attr: string): Component;
|
||||
getDOMAttribute(attr: string): any;
|
||||
getObject3D(type: string): THREE.Object3D;
|
||||
getOrCreateObject3D(type: string, construct: any): THREE.Object3D;
|
||||
is(stateName: string): boolean;
|
||||
pause(): void;
|
||||
play(): void;
|
||||
setObject3D(type: string, obj: THREE.Object3D): void;
|
||||
removeAttribute(attr: string, property?: string): void;
|
||||
removeObject3D(type: string): void;
|
||||
removeState(stateName: string): void;
|
||||
|
||||
// getAttribute specific usages
|
||||
getAttribute(type: string): any;
|
||||
getAttribute(type: 'position' | 'rotation' | 'scale'): Coordinate;
|
||||
|
||||
// setAttribute specific usages
|
||||
setAttribute(attr: string, value: any): void;
|
||||
setAttribute(attr: string, property: string, componentAttrValue?: any): void;
|
||||
setAttribute(type: 'position' | 'rotation' | 'scale', value: Coordinate): void;
|
||||
|
||||
// addEventListener specific usages
|
||||
addEventListener<K extends keyof EntityEventMap>(
|
||||
type: K,
|
||||
listener: (event: Event & EntityEventMap[K]) => void,
|
||||
useCapture?: boolean
|
||||
): void;
|
||||
addEventListener(
|
||||
type: string,
|
||||
listener: EventListenerOrEventListenerObject,
|
||||
useCapture?: boolean
|
||||
): void;
|
||||
}
|
||||
|
||||
export type DetailEvent<D> = Event & {
|
||||
detail: D;
|
||||
target: EventTarget & Entity;
|
||||
};
|
||||
|
||||
export interface EntityEventMap {
|
||||
'child-attached': DetailEvent<{ el: Element | Entity }>;
|
||||
'child-detached': DetailEvent<{ el: Element | Entity }>;
|
||||
componentchanged: DetailEvent<{
|
||||
name: string;
|
||||
geometry: THREE.Geometry;
|
||||
schema: Schema<any>;
|
||||
id: string;
|
||||
}>;
|
||||
componentremoved: DetailEvent<{
|
||||
name: string;
|
||||
id: string;
|
||||
newData: any;
|
||||
oldData: any;
|
||||
}>;
|
||||
loaded: EventListener;
|
||||
pause: EventListener;
|
||||
play: EventListener;
|
||||
stateadded: DetailEvent<{ state: string }>;
|
||||
stateremoved: DetailEvent<{ state: string }>;
|
||||
schemachanged: DetailEvent<{ componentName: string }>;
|
||||
}
|
||||
|
||||
init(this: this, data: { [P in keyof this['schema']]: any }): void;
|
||||
// Would like the above to be:
|
||||
// init?(this: this, data?: { [P in keyof T['schema']]: T['schema'][P]['default'] } ): void;
|
||||
// I think this is prevented by the following issue: https://github.com/Microsoft/TypeScript/issues/21760.
|
||||
}
|
||||
export interface Geometry<T = any> {
|
||||
data: T;
|
||||
name: string;
|
||||
geometry: THREE.Geometry;
|
||||
schema: Schema<any>;
|
||||
|
||||
interface GeometryConstructor<T extends Geometry> {
|
||||
new (): T;
|
||||
}
|
||||
init(data: any): void;
|
||||
}
|
||||
|
||||
type GeometryDefinition<T extends Geometry = Geometry> = Partial<T>;
|
||||
export interface GeometryConstructor<T extends object = object> {
|
||||
new (): T & Geometry;
|
||||
}
|
||||
|
||||
interface GeometryDescriptor<T extends Geometry = Geometry> {
|
||||
Geometry: GeometryConstructor<T>;
|
||||
schema: Schema;
|
||||
}
|
||||
export interface GeometryDescriptor<T extends Geometry = Geometry> {
|
||||
Geometry: GeometryConstructor<T>;
|
||||
schema: Schema;
|
||||
}
|
||||
|
||||
type MultiPropertySchema<T extends { [key: string ]: any }> = {
|
||||
[P in keyof T]: SinglePropertySchema<T[P]> | T[P];
|
||||
export type MultiPropertySchema<T extends object> = {
|
||||
[P in keyof T]: SinglePropertySchema<T[P]> | T[P]
|
||||
};
|
||||
|
||||
export type PropertyTypes =
|
||||
| 'array'
|
||||
| 'asset'
|
||||
| 'audio'
|
||||
| 'boolean'
|
||||
| 'color'
|
||||
| 'int'
|
||||
| 'map'
|
||||
| 'model'
|
||||
| 'number'
|
||||
| 'selector'
|
||||
| 'selectorAll'
|
||||
| 'string'
|
||||
| 'vec2'
|
||||
| 'vec3'
|
||||
| 'vec4';
|
||||
|
||||
export type SceneEvents = 'enter-vr' | 'exit-vr' | 'loaded' | 'renderstart';
|
||||
|
||||
export interface Scene extends Entity {
|
||||
behaviors: Behavior[];
|
||||
camera: THREE.Camera;
|
||||
canvas: HTMLCanvasElement;
|
||||
effect: THREE.VREffect;
|
||||
isMobile: boolean;
|
||||
object3D: THREE.Scene;
|
||||
renderer: THREE.WebGLRenderer;
|
||||
renderStarted: boolean;
|
||||
systems: ObjectMap<System>;
|
||||
time: number;
|
||||
|
||||
enterVR(): Promise<void> | void;
|
||||
exitVR(): Promise<void> | void;
|
||||
reload(): void;
|
||||
|
||||
addEventListener(
|
||||
type: string,
|
||||
listener: EventListenerOrEventListenerObject,
|
||||
useCapture?: boolean
|
||||
): void;
|
||||
addEventListener(type: SceneEvents, listener: EventListener, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
export type Schema<T extends object = object> = SinglePropertySchema<T> | MultiPropertySchema<T>;
|
||||
|
||||
export interface SchemaUtils {
|
||||
isSingleProperty(schema: Schema): boolean;
|
||||
process(schema: Schema): boolean;
|
||||
}
|
||||
|
||||
export interface Shader {
|
||||
name: string;
|
||||
data: object;
|
||||
schema: Schema<this['data']>;
|
||||
material: THREE.Material;
|
||||
vertexShader: string;
|
||||
fragmentShader: string;
|
||||
|
||||
init(data?: this['data']): void;
|
||||
tick?(time: number, timeDelta: number): void;
|
||||
update(oldData: this['data']): void;
|
||||
}
|
||||
|
||||
export interface ShaderConstructor<T extends object> {
|
||||
new (): T;
|
||||
}
|
||||
|
||||
export interface ShaderDescriptor<T extends Shader = Shader> {
|
||||
Shader: ShaderConstructor<T>;
|
||||
schema: Schema;
|
||||
}
|
||||
|
||||
export interface SinglePropertySchema<T> {
|
||||
type?: PropertyTypes;
|
||||
default?: T;
|
||||
parse?(value: string): T;
|
||||
stringify?(value: T): string;
|
||||
}
|
||||
|
||||
export interface System<T extends object = any> {
|
||||
data: T;
|
||||
schema: Schema<T>;
|
||||
init(): void;
|
||||
pause(): void;
|
||||
play(): void;
|
||||
tick?(t: number, dt: number): void;
|
||||
}
|
||||
|
||||
export interface SystemConstructor<T extends object = object> {
|
||||
new (scene: Scene): T & System;
|
||||
}
|
||||
|
||||
export interface Utils {
|
||||
coordinates: {
|
||||
isCoordinate(value: string): boolean;
|
||||
parse(value: string): Coordinate;
|
||||
stringify(coord: Coordinate): string;
|
||||
};
|
||||
entity: {
|
||||
getComponentProperty(entity: Entity, componentName: string, delimiter?: string): any;
|
||||
setComponentProperty(
|
||||
entity: Entity,
|
||||
componentName: string,
|
||||
value: any,
|
||||
delimiter?: string
|
||||
): void;
|
||||
};
|
||||
styleParser: {
|
||||
parse(value: string): object;
|
||||
stringify(data: object): string;
|
||||
};
|
||||
deepEqual(a: any, b: any): boolean;
|
||||
diff(a: object, b: object): object;
|
||||
extend(target: object, ...source: object[]): object;
|
||||
extendDeep(target: object, ...source: object[]): object;
|
||||
|
||||
interface PrimitiveDefinition {
|
||||
defaultComponents?: any; // TODO cleanup type
|
||||
deprecated?: boolean;
|
||||
mappings?: any; // TODO cleanup type
|
||||
transforms?: any; // TODO cleanup type
|
||||
}
|
||||
throttle(
|
||||
tickFunction: () => void,
|
||||
minimumInterval: number,
|
||||
optionalContext?: {}
|
||||
): (t: number, dt: number) => void;
|
||||
throttleTick(
|
||||
tickFunction: (t: number, dt: number) => void,
|
||||
minimumInterval: number,
|
||||
optionalContext?: {}
|
||||
): (t: number, dt: number) => void;
|
||||
}
|
||||
|
||||
type PropertyTypes = 'array' | 'asset' | 'audio' | 'boolean' | 'color' |
|
||||
'int' | 'map' | 'model' | 'number' | 'selector' | 'selectorAll' |
|
||||
'string' | 'vec2' | 'vec3' | 'vec4';
|
||||
// Definitions
|
||||
// used as mixins to register functions to create classes (newable functions) in A-Frame
|
||||
export type ComponentDefinition<T extends object = object> = T & Partial<Component>;
|
||||
export type GeometryDefinition<T extends object = object, U = any> = T & Partial<Geometry<U>>;
|
||||
export type NodeDefinition<T extends object = object> = T & Partial<ANode>;
|
||||
export interface PrimitiveDefinition {
|
||||
defaultComponents?: any; // TODO cleanup type
|
||||
deprecated?: boolean;
|
||||
mappings?: any; // TODO cleanup type
|
||||
transforms?: any; // TODO cleanup type
|
||||
}
|
||||
export interface MinimalShaderDefinition {
|
||||
schema: Shader['schema'];
|
||||
}
|
||||
export type ShaderDefinition<T extends object = MinimalShaderDefinition & object> = T &
|
||||
Partial<Shader>;
|
||||
export type SystemDefinition<T extends object = object> = T & Partial<System>;
|
||||
|
||||
type SceneEvents = 'enter-vr' | 'exit-vr' | 'loaded' | 'renderstart';
|
||||
// root export
|
||||
export interface AFrame {
|
||||
AComponent: Component;
|
||||
AEntity: Entity;
|
||||
ANode: ANode;
|
||||
AScene: Scene;
|
||||
|
||||
interface Scene extends Entity {
|
||||
behaviors: Behavior[];
|
||||
camera: THREE.Camera;
|
||||
canvas: HTMLCanvasElement;
|
||||
effect: THREE.VREffect;
|
||||
isMobile: boolean;
|
||||
object3D: THREE.Scene;
|
||||
renderer: THREE.WebGLRenderer;
|
||||
renderStarted: boolean;
|
||||
systems: ObjectMap<System>;
|
||||
time: number;
|
||||
|
||||
enterVR(): Promise<void> | void;
|
||||
exitVR(): Promise<void> | void;
|
||||
reload(): void;
|
||||
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
addEventListener(type: SceneEvents, listener: EventListener, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
type Schema<T = { [key: string]: any }> = SinglePropertySchema<T> | MultiPropertySchema<T>;
|
||||
|
||||
interface SchemaUtils {
|
||||
isSingleProperty(schema: Schema): boolean;
|
||||
process(schema: Schema): boolean;
|
||||
}
|
||||
|
||||
interface Shader {
|
||||
name: string;
|
||||
data: { [key: string]: any };
|
||||
schema: Schema<this['data']>;
|
||||
material: THREE.Material;
|
||||
vertexShader: string;
|
||||
fragmentShader: string;
|
||||
|
||||
init(this: this, data?: this['data']): void;
|
||||
tick?(this: this, time: number, timeDelta: number): void;
|
||||
update(this: this, oldData: this['data']): void;
|
||||
}
|
||||
|
||||
interface ShaderConstructor<T extends Shader> {
|
||||
new (): T;
|
||||
}
|
||||
|
||||
type ShaderDefinition<T extends Shader = Shader> = Partial<T>;
|
||||
|
||||
interface ShaderDescriptor<T extends Shader = Shader> {
|
||||
Shader: ShaderConstructor<T>;
|
||||
schema: Schema;
|
||||
}
|
||||
|
||||
interface SinglePropertySchema<T> {
|
||||
type?: PropertyTypes;
|
||||
'default'?: T;
|
||||
parse?(value: string): T;
|
||||
stringify?(value: T): string;
|
||||
}
|
||||
|
||||
interface System {
|
||||
data: { [key: string]: any };
|
||||
schema: Schema<this['data']>;
|
||||
init(this: this): void;
|
||||
pause(this: this): void;
|
||||
play(this: this): void;
|
||||
tick?(this: this, t: number, dt: number): void;
|
||||
}
|
||||
|
||||
interface SystemConstructor<T extends System = System> {
|
||||
new (scene: Scene): T;
|
||||
}
|
||||
|
||||
type SystemDefinition<T extends System = System> = Partial<T>;
|
||||
|
||||
interface Utils {
|
||||
coordinates: {
|
||||
isCoordinate(value: string): boolean;
|
||||
parse(value: string): Coordinate;
|
||||
stringify(coord: Coordinate): string;
|
||||
components: ObjectMap<ComponentDescriptor>;
|
||||
geometries: ObjectMap<GeometryDescriptor>;
|
||||
primitives: {
|
||||
getMeshMixin(): {
|
||||
defaultComponents: { material: object };
|
||||
mappings: { [key: string]: any }; // TODO improve any type
|
||||
};
|
||||
entity: {
|
||||
getComponentProperty(entity: Entity, componentName: string, delimiter?: string): any;
|
||||
setComponentProperty(entity: Entity, componentName: string, value: any, delimiter?: string): void;
|
||||
};
|
||||
styleParser: {
|
||||
parse(value: string): object;
|
||||
stringify(data: object): string;
|
||||
};
|
||||
deepEqual(a: any, b: any): boolean;
|
||||
diff(a: object, b: object): object;
|
||||
extend(target: object, ... source: object[]): object;
|
||||
extendDeep(target: object, ... source: object[]): object;
|
||||
primitives: ObjectMap<Entity>;
|
||||
};
|
||||
scenes: Scene[];
|
||||
schema: SchemaUtils;
|
||||
shaders: ObjectMap<ShaderDescriptor>;
|
||||
systems: ObjectMap<SystemConstructor>;
|
||||
THREE: ThreeLib;
|
||||
TWEEN: TweenLib;
|
||||
utils: Utils;
|
||||
version: string;
|
||||
|
||||
throttle(tickFunction: () => void, minimumInterval: number, optionalContext?: {}): (t: number, dt: number) => void;
|
||||
throttleTick(tickFunction: (t: number, dt: number) => void, minimumInterval: number, optionalContext?: {}): (t: number, dt: number) => void;
|
||||
registerComponent<T extends object>(
|
||||
name: string,
|
||||
component: ComponentDefinition<T>
|
||||
): ComponentConstructor<T>;
|
||||
registerElement(name: string, element: object): void;
|
||||
registerGeometry<T extends object>(
|
||||
name: string,
|
||||
geometry: GeometryDefinition<T>
|
||||
): GeometryConstructor<T>;
|
||||
registerPrimitive(name: string, primitive: PrimitiveDefinition): void;
|
||||
registerShader<T extends MinimalShaderDefinition & object>(
|
||||
name: string,
|
||||
shader: ShaderDefinition<T>
|
||||
): ShaderConstructor<T>;
|
||||
registerSystem<T extends object>(
|
||||
name: string,
|
||||
definition: SystemDefinition<T>
|
||||
): SystemConstructor<T>;
|
||||
}
|
||||
|
||||
// module.exports
|
||||
export const AComponent: AFrame['AComponent'];
|
||||
export const AEntity: AFrame['AEntity'];
|
||||
export const ANode: AFrame['ANode'];
|
||||
export const AScene: AFrame['AScene'];
|
||||
export const components: AFrame['components'];
|
||||
export const geometries: AFrame['geometries'];
|
||||
export const primitives: AFrame['primitives'];
|
||||
export const scenes: AFrame['scenes'];
|
||||
export const schema: AFrame['schema'];
|
||||
export const shaders: AFrame['shaders'];
|
||||
export const systems: AFrame['systems'];
|
||||
export const THREE: AFrame['THREE'];
|
||||
export const TWEEN: AFrame['TWEEN'];
|
||||
export const utils: AFrame['utils'];
|
||||
export const version: AFrame['version'];
|
||||
export const registerComponent: AFrame['registerComponent'];
|
||||
export const registerElement: AFrame['registerElement'];
|
||||
export const registerGeometry: AFrame['registerGeometry'];
|
||||
export const registerPrimitive: AFrame['registerPrimitive'];
|
||||
export const registerShader: AFrame['registerShader'];
|
||||
export const registerSystem: AFrame['registerSystem'];
|
||||
|
||||
// global exports
|
||||
declare global {
|
||||
var hasNativeWebVRImplementation: boolean;
|
||||
|
||||
namespace AFRAME {
|
||||
const AComponent: AFrame['AComponent'];
|
||||
const AEntity: AFrame['AEntity'];
|
||||
const ANode: AFrame['ANode'];
|
||||
const AScene: AFrame['AScene'];
|
||||
const components: AFrame['components'];
|
||||
const geometries: AFrame['geometries'];
|
||||
const primitives: AFrame['primitives'];
|
||||
const scenes: AFrame['scenes'];
|
||||
const schema: AFrame['schema'];
|
||||
const shaders: AFrame['shaders'];
|
||||
const systems: AFrame['systems'];
|
||||
const THREE: AFrame['THREE'];
|
||||
const TWEEN: AFrame['TWEEN'];
|
||||
const utils: AFrame['utils'];
|
||||
const version: string;
|
||||
|
||||
const registerComponent: AFrame['registerComponent'];
|
||||
const registerElement: AFrame['registerElement'];
|
||||
const registerGeometry: AFrame['registerGeometry'];
|
||||
const registerPrimitive: AFrame['registerPrimitive'];
|
||||
const registerShader: AFrame['registerShader'];
|
||||
const registerSystem: AFrame['registerSystem'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom elements augment document methods to return custom HTML
|
||||
*/
|
||||
interface Document {
|
||||
createElement(tagName: string): Entity;
|
||||
querySelector(selectors: 'a-scene'): Scene;
|
||||
querySelector(selectors: string): Entity<any>;
|
||||
querySelectorAll(selectors: string): NodeListOf<Entity<any> | Element>;
|
||||
}
|
||||
|
||||
interface HTMLCollection extends HTMLCollectionBase {
|
||||
/**
|
||||
* Retrieves a select object or an object from an options collection.
|
||||
*/
|
||||
namedItem(name: string): Element | Entity | null;
|
||||
item(index: number): Element | Entity;
|
||||
[index: number]: Element | Entity;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,14 @@
|
||||
import {
|
||||
Component,
|
||||
Entity,
|
||||
MultiPropertySchema,
|
||||
System,
|
||||
SystemDefinition,
|
||||
THREE,
|
||||
Geometry,
|
||||
registerComponent
|
||||
} from 'aframe';
|
||||
|
||||
// Global
|
||||
const threeCamera = new AFRAME.THREE.Camera();
|
||||
AFRAME.TWEEN.Easing;
|
||||
@@ -16,7 +27,7 @@ entity.setAttribute('material', 'color', 'red');
|
||||
|
||||
entity.components['geometry'].data;
|
||||
|
||||
type MyEntity = AFrame.Entity<{
|
||||
type MyEntity = Entity<{
|
||||
camera: THREE.Camera;
|
||||
material: THREE.Material;
|
||||
sound: { pause(): void };
|
||||
@@ -33,29 +44,31 @@ entity.setAttribute('light', {
|
||||
intensity: 2.0
|
||||
});
|
||||
|
||||
entity.addEventListener('child-detached', (event) => {
|
||||
entity.addEventListener('child-detached', event => {
|
||||
event.detail;
|
||||
});
|
||||
|
||||
// Components
|
||||
|
||||
interface TestComponent extends AFrame.Component {
|
||||
multiply: (f: number) => number;
|
||||
// interface TestComponent extends Component {
|
||||
// multiply: (f: number) => number;
|
||||
//
|
||||
// data: {
|
||||
// myProperty: any[],
|
||||
// string: string,
|
||||
// num: number
|
||||
// };
|
||||
//
|
||||
// system: TestSystem;
|
||||
// }
|
||||
|
||||
data: {
|
||||
myProperty: any[],
|
||||
string: string,
|
||||
num: number
|
||||
};
|
||||
|
||||
system: TestSystem;
|
||||
}
|
||||
|
||||
const Component = AFRAME.registerComponent<TestComponent>('test-component', {
|
||||
const Component = registerComponent('test-component', {
|
||||
schema: {
|
||||
myProperty: {
|
||||
default: [],
|
||||
parse() { return [true]; },
|
||||
parse() {
|
||||
return [true];
|
||||
}
|
||||
},
|
||||
string: { type: 'string' },
|
||||
num: 0
|
||||
@@ -69,9 +82,9 @@ const Component = AFRAME.registerComponent<TestComponent>('test-component', {
|
||||
pause() {},
|
||||
play() {},
|
||||
|
||||
multiply(this: TestComponent, f: number) {
|
||||
multiply(f: number) {
|
||||
// Reference to system because both were registered with the same name.
|
||||
return f * this.data.num * this.system.data.counter;
|
||||
return f * this.data.num * this.system!.data.counter;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -81,13 +94,7 @@ scene.hasLoaded;
|
||||
|
||||
// System
|
||||
|
||||
interface TestSystem extends AFrame.System {
|
||||
data: {
|
||||
counter: number;
|
||||
};
|
||||
}
|
||||
|
||||
const testSystem: AFrame.SystemDefinition<TestSystem> = {
|
||||
const testSystem: SystemDefinition = {
|
||||
schema: {
|
||||
counter: 0
|
||||
},
|
||||
@@ -101,13 +108,7 @@ AFRAME.registerSystem('test-component', testSystem);
|
||||
|
||||
// Register Custom Geometry
|
||||
|
||||
interface TestGeometry extends AFrame.Geometry {
|
||||
schema: AFrame.MultiPropertySchema<{
|
||||
groupIndex: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
AFRAME.registerGeometry<TestGeometry>('a-test-geometry', {
|
||||
AFRAME.registerGeometry('a-test-geometry', {
|
||||
schema: {
|
||||
groupIndex: { default: 0 }
|
||||
},
|
||||
@@ -21,6 +21,7 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"aframe-tests.ts"
|
||||
"test/aframe-tests.ts",
|
||||
"test/aframe-io-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"redux": "^3.6.0"
|
||||
"ajv": "*"
|
||||
}
|
||||
}
|
||||
Vendored
+6
-2
@@ -1128,7 +1128,7 @@ declare namespace algoliasearch {
|
||||
* default: ""
|
||||
* https://github.com/algolia/algoliasearch-client-js#facets
|
||||
*/
|
||||
facets?: string;
|
||||
facets?: string | string[];
|
||||
/**
|
||||
* Limit the number of facet values returned for each facet.
|
||||
* default: ""
|
||||
@@ -1375,7 +1375,7 @@ declare namespace algoliasearch {
|
||||
* Filter the query by a set of facets.
|
||||
* https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated
|
||||
*/
|
||||
facetFilters?: string;
|
||||
facetFilters?: string | string[]
|
||||
/**
|
||||
* If set to false, this query will not be taken into account in the analytics feature.
|
||||
* default true
|
||||
@@ -1421,6 +1421,10 @@ declare namespace algoliasearch {
|
||||
* The query for the search in this facet
|
||||
*/
|
||||
facetQuery: string;
|
||||
/**
|
||||
* The maximum number of facets to fetch
|
||||
*/
|
||||
maxFacetHits?: number;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
|
||||
@@ -36,7 +36,9 @@ app.controller('Ctrl', ($scope: ng.IScope, blockUI: angular.blockUI.BlockUIServi
|
||||
blockUI.stop();
|
||||
blockUI.reset();
|
||||
blockUI.message("Hello Types");
|
||||
blockUI.done();
|
||||
blockUI.done(() => {
|
||||
console.log("blockUI stopped");
|
||||
});
|
||||
const b: boolean = blockUI.isBlocking();
|
||||
|
||||
const myBlockUI = blockUI.instances.get("myBlockUI");
|
||||
|
||||
Vendored
+29
-14
@@ -1,6 +1,8 @@
|
||||
// Type definitions for angular-block-ui 0.2
|
||||
// Project: https://github.com/McNull/angular-block-ui
|
||||
// Definitions by: Lasse Nørregaard <https://github.com/lassebn>, Stephan Classen <https://github.com/sclassen>, Soner Köksal <https://github.com/renjfk>
|
||||
// Definitions by: Lasse Nørregaard <https://github.com/lassebn>
|
||||
// Stephan Classen <https://github.com/sclassen>
|
||||
// Soner Köksal <https://github.com/renjfk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -48,6 +50,8 @@ declare module 'angular' {
|
||||
*
|
||||
* If you don't want this behaviour and want to do all the
|
||||
* blocking manually you can change this value to false.
|
||||
*
|
||||
* The default value is 'true'
|
||||
*/
|
||||
autoBlock?: boolean;
|
||||
|
||||
@@ -56,6 +60,8 @@ declare module 'angular' {
|
||||
* hide the overlay whenever an exception has occurred.
|
||||
*
|
||||
* You can set this value to false if you don't want this behaviour.
|
||||
*
|
||||
* The default value is 'true'
|
||||
*/
|
||||
resetOnException?: boolean;
|
||||
|
||||
@@ -74,33 +80,42 @@ declare module 'angular' {
|
||||
|
||||
/**
|
||||
* When the module is started it will inject the main block element
|
||||
* by adding the block-ui directive to the body element.
|
||||
* by adding the "block-ui" directive to the <body> element.
|
||||
*
|
||||
* Set this to false if there no need for any fullscreen blocking or if there's
|
||||
* more control required. For instance when your ng-app directive is a child
|
||||
* element of the body element it is impossible for the blockUI resolve the main
|
||||
* instance. In such a case the auto injection of the main block scope should
|
||||
* be disabled and the main block element should be relocated.
|
||||
*
|
||||
* The default value is 'true'
|
||||
*/
|
||||
autoInjectBodyBlock?: boolean;
|
||||
|
||||
/**
|
||||
* A string containing the default css classes, separated by spaces,
|
||||
* A string containing the default css classes (separated by spaces)
|
||||
* that should be applied to each block-ui element.
|
||||
*
|
||||
* The default value is `block-ui block-ui-anim-fade`
|
||||
* The default value is "block-ui block-ui-anim-fade"
|
||||
*/
|
||||
cssClass?: string;
|
||||
|
||||
/**
|
||||
* Whenever a user interface block is active, because the single page
|
||||
* application is still waiting for a response from the backend server,
|
||||
* the user can still navigate away using the back and forward buttons
|
||||
* of the browser.
|
||||
* While a user interface block is active the user can still navigate
|
||||
* away using the back and forward buttons of the browser.
|
||||
*
|
||||
* Callbacks registered to handle the responses from the server will
|
||||
* be executed even if a different view/controller is currently active.
|
||||
* By setting the blockBrowserNavigation property to true the
|
||||
* angular-block-ui module will prevent navigation while a fullscreen
|
||||
* Callbacks registered to handle responses from the server will
|
||||
* be executed even if a different view/controller is active at the
|
||||
* time the response arrives.
|
||||
*
|
||||
* You can set this value to true if you want to prevent navigation
|
||||
* with the browser back and forward buttons while a fullscreen
|
||||
* block is active.
|
||||
*
|
||||
* Programatic location changes via the $location service are still
|
||||
* allowed however.
|
||||
* The navigation block is disabled by default.
|
||||
*
|
||||
* The default value is 'false'
|
||||
*/
|
||||
blockBrowserNavigation?: boolean;
|
||||
}
|
||||
@@ -150,7 +165,7 @@ declare module 'angular' {
|
||||
* This can be useful whenever you wish to redirect the user
|
||||
* to a different location while there are still pending AJAX requests.
|
||||
*/
|
||||
done(): void;
|
||||
done(doneCallback: () => void): void;
|
||||
|
||||
/**
|
||||
* Allows the message shown in the overlay to be updated
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
"index.d.ts",
|
||||
"angular-block-ui-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,9 +132,8 @@ myApp.controller('sortableController', function ($scope: MySortableControllerSco
|
||||
$scope.sortableOptions.tolerance = 'pointer';
|
||||
$scope.sortableOptions.zIndex = 9999;
|
||||
|
||||
$scope.sortableOptions['ui-floating'] = undefined;
|
||||
$scope.sortableOptions['ui-floating'] = null;
|
||||
$scope.sortableOptions['ui-floating'] = false;
|
||||
$scope.sortableOptions['ui-floating'] = true;
|
||||
$scope.sortableOptions['ui-floating'] = "auto";
|
||||
const sortableFloatingOption0: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': undefined };
|
||||
const sortableFloatingOption1: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': false };
|
||||
const sortableFloatingOption2: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': true };
|
||||
const sortableFloatingOption3: ng.ui.UISortableOptions<SortableModelInfo> = { 'ui-floating': 'auto' };
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ declare module 'angular' {
|
||||
export namespace ui {
|
||||
|
||||
interface UISortableOptions<T> extends SortableOptions<T> {
|
||||
'ui-floating'?: string | boolean;
|
||||
'ui-floating'?: 'auto' | boolean;
|
||||
}
|
||||
|
||||
interface UISortableProperties<T> {
|
||||
|
||||
Vendored
+1
-1
@@ -1316,7 +1316,7 @@ declare namespace angular {
|
||||
*
|
||||
* @param key the key of the data to be retrieved
|
||||
*/
|
||||
get<T>(key: string): T;
|
||||
get<T>(key: string): T | undefined;
|
||||
|
||||
/**
|
||||
* Removes an entry from the Cache object.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import * as antlr4 from 'antlr4';
|
||||
import * as autosuggest from 'antlr4-autosuggest';
|
||||
|
||||
class Antlr4JSLexer extends antlr4.Lexer {
|
||||
constructor(chars: antlr4.InputStream) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
class Antlr4JSParser extends antlr4.Parser {
|
||||
constructor(tokens: antlr4.CommonTokenStream) {
|
||||
super(tokens);
|
||||
}
|
||||
}
|
||||
|
||||
const autosuggester: autosuggest.AutoSuggester = autosuggest.autosuggester(Antlr4JSLexer, Antlr4JSParser);
|
||||
const suggestions: string[] = autosuggester.autosuggest('ABC');
|
||||
|
||||
const lowercase = autosuggest.autosuggester(Antlr4JSLexer, Antlr4JSParser, 'LOWER');
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for antlr4-autosuggest 0.0
|
||||
// Project: https://github.com/oranoran/antlr4-autosuggest-js
|
||||
// Definitions by: Jon Freedman <https://github.com/jonfreedman>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as antlr4 from 'antlr4';
|
||||
|
||||
export type CasePreference = 'LOWER' | 'UPPER' | 'BOTH';
|
||||
|
||||
export interface AutoSuggester {
|
||||
autosuggest: (inputText: string) => string[];
|
||||
}
|
||||
|
||||
export interface Constructor<T> {
|
||||
new (...args: any[]): T;
|
||||
}
|
||||
|
||||
export function autosuggester(lexerCtr: Constructor<antlr4.Lexer>, parserCtr: Constructor<antlr4.Parser>, casePref?: CasePreference | null): AutoSuggester;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"antlr4-autosuggest-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -17,7 +17,6 @@ const config: Microsoft.ApplicationInsights.IConfig = {
|
||||
autoTrackPageVisitTime: true,
|
||||
disableExceptionTracking: false,
|
||||
disableAjaxTracking: false,
|
||||
disableFetchTracking: true,
|
||||
overridePageViewDuration: false,
|
||||
maxAjaxCallsPerView: -1,
|
||||
disableDataLossAnalysis: true,
|
||||
|
||||
+3
-3
@@ -1,7 +1,8 @@
|
||||
// Type definitions for ApplicationInsights-JS 1.0
|
||||
// Project: https://github.com/Microsoft/ApplicationInsights-JS
|
||||
// Definitions by: Kamil Szostak <https://github.com/kamilszostak>
|
||||
// Mark Wolff <https://github.com/markwolff>
|
||||
// Definitions by: Mark Wolff <https://github.com/markwolff>
|
||||
// Piyali Jana <https://github.com/jpiyali>
|
||||
// Basal Rustum <https://github.com/barustum>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module AI {
|
||||
@@ -561,7 +562,6 @@ declare module Microsoft.ApplicationInsights {
|
||||
samplingPercentage?: number;
|
||||
autoTrackPageVisitTime?: boolean;
|
||||
disableAjaxTracking?: boolean;
|
||||
disableFetchTracking?: boolean;
|
||||
overridePageViewDuration?: boolean;
|
||||
maxAjaxCallsPerView?: number;
|
||||
disableDataLossAnalysis?: boolean;
|
||||
|
||||
@@ -400,10 +400,10 @@ cognitoUserPoolEvent.request.session![0].challengeName === "DEVICE_SRP_AUTH";
|
||||
cognitoUserPoolEvent.request.session![0].challengeName === "DEVICE_PASSWORD_VERIFIER";
|
||||
cognitoUserPoolEvent.request.session![0].challengeName === "ADMIN_NO_SRP_AUTH";
|
||||
bool = cognitoUserPoolEvent.request.session![0].challengeResult;
|
||||
strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetaData;
|
||||
strOrUndefined = cognitoUserPoolEvent.request.session![0].challengeMetadata;
|
||||
strOrUndefined = cognitoUserPoolEvent.request.challengeName;
|
||||
str = cognitoUserPoolEvent.request.privateChallengeParameters!["answer"];
|
||||
str = cognitoUserPoolEvent.request.challengeAnswer!["answer"];
|
||||
str = cognitoUserPoolEvent.request.challengeAnswer!;
|
||||
boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect;
|
||||
strOrUndefined = cognitoUserPoolEvent.response.smsMessage;
|
||||
strOrUndefined = cognitoUserPoolEvent.response.emailMessage;
|
||||
@@ -413,7 +413,7 @@ boolOrUndefined = cognitoUserPoolEvent.response.issueTokens;
|
||||
boolOrUndefined = cognitoUserPoolEvent.response.failAuthentication;
|
||||
str = cognitoUserPoolEvent.response.publicChallengeParameters!["captchaUrl"];
|
||||
str = cognitoUserPoolEvent.response.privateChallengeParameters!["answer"];
|
||||
strOrUndefined = cognitoUserPoolEvent.response.challengeMetaData;
|
||||
strOrUndefined = cognitoUserPoolEvent.response.challengeMetadata;
|
||||
boolOrUndefined = cognitoUserPoolEvent.response.answerCorrect;
|
||||
|
||||
// CloudFormation Custom Resource
|
||||
@@ -581,7 +581,7 @@ const CodePipelineEvent: AWSLambda.CodePipelineEvent = {
|
||||
CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' };
|
||||
|
||||
/* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */
|
||||
const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = {
|
||||
const CloudFrontRequestWithCustomOriginEvent: AWSLambda.CloudFrontRequestEvent = {
|
||||
Records: [
|
||||
{
|
||||
cf: {
|
||||
@@ -630,7 +630,44 @@ const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = {
|
||||
"TLSv1",
|
||||
"TLSv1.1"
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const CloudFrontRequestWithS3OriginEvent: AWSLambda.CloudFrontRequestEvent = {
|
||||
Records: [
|
||||
{
|
||||
cf: {
|
||||
config: {
|
||||
distributionDomainName: "d123.cloudfront.net",
|
||||
distributionId: "EDFDVBD6EXAMPLE",
|
||||
eventType: "viewer-request",
|
||||
requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE=="
|
||||
},
|
||||
request: {
|
||||
clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334",
|
||||
method: "GET",
|
||||
uri: "/picture.jpg",
|
||||
querystring: "size=large",
|
||||
headers: {
|
||||
host: [
|
||||
{
|
||||
key: "Host",
|
||||
value: "d111111abcdef8.cloudfront.net"
|
||||
}
|
||||
],
|
||||
"user-agent": [
|
||||
{
|
||||
key: "User-Agent",
|
||||
value: "curl/7.51.0"
|
||||
}
|
||||
]
|
||||
},
|
||||
origin: {
|
||||
s3: {
|
||||
authMethod: "origin-access-identity",
|
||||
customHeaders: {
|
||||
@@ -812,6 +849,56 @@ apiGtwProxyHandler = proxyHandler;
|
||||
const codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback<void>) => {};
|
||||
|
||||
const cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => {
|
||||
event = CloudFrontRequestWithCustomOriginEvent;
|
||||
// $ExpectType CloudFrontRequestEvent
|
||||
event;
|
||||
let request = event.Records[0].cf.request;
|
||||
|
||||
let s3Origin: AWSLambda.CloudFrontS3Origin = {
|
||||
authMethod: 'none',
|
||||
customHeaders: {},
|
||||
domainName: 'example.com',
|
||||
path: '/',
|
||||
region: 'us-east-1'
|
||||
};
|
||||
|
||||
if (request.origin && request.origin.custom) {
|
||||
request.origin.custom.domainName;
|
||||
request.origin.custom.domainName = "example2.com";
|
||||
|
||||
// $ExpectError
|
||||
s3Origin = request.origin.s3;
|
||||
|
||||
// $ExpectError
|
||||
request.origin.s3.path = '/';
|
||||
}
|
||||
|
||||
let customOrigin: AWSLambda.CloudFrontCustomOrigin = {
|
||||
customHeaders: {},
|
||||
domainName: 'example.com',
|
||||
keepaliveTimeout: 60,
|
||||
path: '/',
|
||||
port: 80,
|
||||
protocol: 'http',
|
||||
readTimeout: 30,
|
||||
sslProtocols: []
|
||||
};
|
||||
|
||||
event = CloudFrontRequestWithS3OriginEvent;
|
||||
// $ExpectType CloudFrontRequestEvent
|
||||
event;
|
||||
request = event.Records[0].cf.request;
|
||||
if (request.origin && request.origin.s3) {
|
||||
request.origin.s3.path;
|
||||
request.origin.s3.path = "/new_path";
|
||||
|
||||
// $ExpectError
|
||||
customOrigin = request.origin.custom;
|
||||
|
||||
// $ExpectError
|
||||
request.origin.custom.path = '/';
|
||||
}
|
||||
|
||||
cb();
|
||||
cb(null);
|
||||
cb(new Error(''));
|
||||
|
||||
Vendored
+31
-3
@@ -21,6 +21,7 @@
|
||||
// Jeremy Nagel <https://github.com/jeznag>
|
||||
// Louis Larry <https://github.com/louislarry>
|
||||
// Daniel Papukchiev <https://github.com/dpapukchiev>
|
||||
// Oliver Hookins <https://github.com/ohookins>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -250,11 +251,11 @@ export interface CognitoUserPoolTriggerEvent {
|
||||
session?: Array<{
|
||||
challengeName: "CUSTOM_CHALLENGE" | "PASSWORD_VERIFIER" | "SMS_MFA" | "DEVICE_SRP_AUTH" | "DEVICE_PASSWORD_VERIFIER" | "ADMIN_NO_SRP_AUTH";
|
||||
challengeResult: boolean;
|
||||
challengeMetaData?: string;
|
||||
challengeMetadata?: string;
|
||||
}>;
|
||||
challengeName?: string;
|
||||
privateChallengeParameters?: { [key: string]: string };
|
||||
challengeAnswer?: { [key: string]: string };
|
||||
challengeAnswer?: string;
|
||||
};
|
||||
response: {
|
||||
autoConfirmUser?: boolean;
|
||||
@@ -266,7 +267,7 @@ export interface CognitoUserPoolTriggerEvent {
|
||||
failAuthentication?: boolean;
|
||||
publicChallengeParameters?: { [key: string]: string };
|
||||
privateChallengeParameters?: { [key: string]: string };
|
||||
challengeMetaData?: string;
|
||||
challengeMetadata?: string;
|
||||
answerCorrect?: boolean;
|
||||
};
|
||||
}
|
||||
@@ -561,6 +562,9 @@ export interface CodePipelineEvent {
|
||||
/**
|
||||
* CloudFront events
|
||||
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
|
||||
* Bear in mind that the "example" event structure in the page above includes
|
||||
* both an S3 and a Custom origin, which is not strictly allowed. Only one
|
||||
* of these per event may be present.
|
||||
*/
|
||||
export interface CloudFrontHeaders {
|
||||
[name: string]: Array<{
|
||||
@@ -569,6 +573,29 @@ export interface CloudFrontHeaders {
|
||||
}>;
|
||||
}
|
||||
|
||||
export type CloudFrontOrigin =
|
||||
| { s3: CloudFrontS3Origin, custom?: never }
|
||||
| { custom: CloudFrontCustomOrigin, s3?: never };
|
||||
|
||||
export interface CloudFrontCustomOrigin {
|
||||
customHeaders: CloudFrontHeaders;
|
||||
domainName: string;
|
||||
keepaliveTimeout: number;
|
||||
path: string;
|
||||
port: number;
|
||||
protocol: 'http' | 'https';
|
||||
readTimeout: number;
|
||||
sslProtocols: string[];
|
||||
}
|
||||
|
||||
export interface CloudFrontS3Origin {
|
||||
authMethod: 'origin-access-identity' | 'none';
|
||||
customHeaders: CloudFrontHeaders;
|
||||
domainName: string;
|
||||
path: string;
|
||||
region: string;
|
||||
}
|
||||
|
||||
export interface CloudFrontResponse {
|
||||
status: string;
|
||||
statusDescription: string;
|
||||
@@ -581,6 +608,7 @@ export interface CloudFrontRequest {
|
||||
uri: string;
|
||||
querystring: string;
|
||||
headers: CloudFrontHeaders;
|
||||
origin?: CloudFrontOrigin;
|
||||
}
|
||||
|
||||
export interface CloudFrontEvent {
|
||||
|
||||
@@ -27,3 +27,6 @@ const mockContext = {
|
||||
};
|
||||
|
||||
awsServerlessExpress.proxy(server, mockEvent, mockContext);
|
||||
awsServerlessExpress.proxy(server, mockEvent, mockContext, 'CALLBACK', () => {});
|
||||
awsServerlessExpress.proxy(server, mockEvent, mockContext, 'CONTEXT_SUCCEED');
|
||||
awsServerlessExpress.proxy(server, mockEvent, mockContext, 'PROMISE').promise.then((response: awsServerlessExpress.Response) => {}).catch(err => {});
|
||||
|
||||
+34
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for aws-serverless-express 3.0
|
||||
// Type definitions for aws-serverless-express 3.3
|
||||
// Project: https://github.com/awslabs/aws-serverless-express
|
||||
// Definitions by: Ben Speakman <https://github.com/threesquared>
|
||||
// Josh Caffey <https://github.com/jcaffey>
|
||||
@@ -11,6 +11,16 @@
|
||||
import * as http from 'http';
|
||||
import * as lambda from 'aws-lambda';
|
||||
|
||||
export interface Response {
|
||||
statusCode: number;
|
||||
body: string;
|
||||
headers: {};
|
||||
}
|
||||
|
||||
export interface ProxyResult {
|
||||
promise: Promise<Response>;
|
||||
}
|
||||
|
||||
export function createServer(
|
||||
requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => void,
|
||||
serverListenCallback?: () => any,
|
||||
@@ -20,5 +30,27 @@ export function createServer(
|
||||
export function proxy(
|
||||
server: http.Server,
|
||||
event: any,
|
||||
context: lambda.Context
|
||||
context: lambda.Context,
|
||||
): http.Server;
|
||||
|
||||
export function proxy(
|
||||
server: http.Server,
|
||||
event: any,
|
||||
context: lambda.Context,
|
||||
resolutionMode: 'CONTEXT_SUCCEED',
|
||||
): void;
|
||||
|
||||
export function proxy(
|
||||
server: http.Server,
|
||||
event: any,
|
||||
context: lambda.Context,
|
||||
resolutionMode: 'PROMISE'
|
||||
): ProxyResult;
|
||||
|
||||
export function proxy(
|
||||
server: http.Server,
|
||||
event: any,
|
||||
context: lambda.Context,
|
||||
resolutionMode: 'CALLBACK',
|
||||
callback?: (error: any, response: Response) => void
|
||||
): void;
|
||||
|
||||
@@ -3,6 +3,7 @@ import bcryptjs = require("bcryptjs");
|
||||
let str: string;
|
||||
let num: number;
|
||||
let bool: boolean;
|
||||
let arr: number[];
|
||||
let error: Error;
|
||||
|
||||
str = bcryptjs.genSaltSync();
|
||||
@@ -63,3 +64,7 @@ bcryptjs.compare("string1", "string2")
|
||||
num = bcryptjs.getRounds("string");
|
||||
|
||||
str = bcryptjs.getSalt("string");
|
||||
|
||||
str = bcryptjs.encodeBase64([1, 2, 3, 4, 5], 5);
|
||||
|
||||
arr = bcryptjs.decodeBase64("string", 5);
|
||||
|
||||
Vendored
+20
-2
@@ -1,8 +1,10 @@
|
||||
// Type definitions for bcryptjs v2.4.0
|
||||
// Project: https://github.com/dcodeIO/bcrypt.js
|
||||
// Definitions by: Joshua Filby <https://github.com/Joshua-F/>, Rafael Kraut <https://github.com/RafaelKr>
|
||||
// Definitions by: Joshua Filby <https://github.com/Joshua-F/>
|
||||
// Rafael Kraut <https://github.com/RafaelKr>
|
||||
// Branislav Holý <https://github.com/branoholy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
|
||||
/**
|
||||
@@ -103,3 +105,19 @@ export declare function getRounds(hash: string): number;
|
||||
* @return Extracted salt part
|
||||
*/
|
||||
export declare function getSalt(hash: string): string;
|
||||
|
||||
/**
|
||||
* Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet.
|
||||
* @function
|
||||
* @param b Byte array
|
||||
* @param len Maximum input length
|
||||
*/
|
||||
export declare function encodeBase64(b: Readonly<ArrayLike<number>>, len: number): string;
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet.
|
||||
* @function
|
||||
* @param s String to decode
|
||||
* @param len Maximum output length
|
||||
*/
|
||||
export declare function decodeBase64(s: string, len: number): number[];
|
||||
|
||||
@@ -5,6 +5,9 @@ async function run() {
|
||||
const server = new Server({ port: 8000 });
|
||||
await server.register(bell);
|
||||
|
||||
bell.simulate(async () => ({}));
|
||||
bell.simulate(() => ({}));
|
||||
|
||||
server.auth.strategy('arcgisonline', 'bell', {
|
||||
provider: 'twitter',
|
||||
password: 'some cookie password',
|
||||
|
||||
Vendored
+2
-5
@@ -1,4 +1,4 @@
|
||||
// Type definitions for bell 9.1
|
||||
// Type definitions for bell 9.3
|
||||
// Project: https://github.com/hapijs/bell
|
||||
// Definitions by: Simon Schick <https://github.com/SimonSchick>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -62,10 +62,7 @@ export type Provider =
|
||||
'wordpress' |
|
||||
'yahoo';
|
||||
|
||||
export type RequestPassThrough = (
|
||||
request: Request,
|
||||
next: (err: Error | null, credentials: AuthCredentials) => void,
|
||||
) => void;
|
||||
export type RequestPassThrough = (request: Request) => PromiseLike<AuthCredentials> | AuthCredentials;
|
||||
|
||||
export interface OptionalOptions {
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { fromBase58 } from 'bip32';
|
||||
|
||||
const node = fromBase58("xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi");
|
||||
|
||||
const child = node.derivePath('m/0');
|
||||
|
||||
const grandchild = child.derive(2);
|
||||
|
||||
grandchild.toWIF() === 'Kxtby4wzfHeCaRXma16dBNLgUE7Ct3Xkb6sRs3aZ56Bmtf1rcNWs';
|
||||
Vendored
+67
@@ -0,0 +1,67 @@
|
||||
// Type definitions for bip32 1.0
|
||||
// Project: https://github.com/bitcoinjs/bip32#readme
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface NetworkType {
|
||||
wif: number; // UInt8
|
||||
bip32: {
|
||||
public: number; // UInt32
|
||||
private: number; // UInt32
|
||||
};
|
||||
}
|
||||
|
||||
export class BIP32 {
|
||||
private constructor(d: Buffer, Q: Buffer, chainCode: Buffer, network: NetworkType);
|
||||
|
||||
identifier: Buffer;
|
||||
fingerprint: Buffer;
|
||||
privateKey: Buffer;
|
||||
publicKey: Buffer;
|
||||
|
||||
private depth: number;
|
||||
private index: number;
|
||||
private parentFingerprint: number;
|
||||
private network: NetworkType;
|
||||
|
||||
isNeutered(): boolean;
|
||||
neutered(): BIP32;
|
||||
toBase58(): string;
|
||||
toWIF(): string;
|
||||
derive(index: number): BIP32;
|
||||
deriveHardened(index: number): BIP32;
|
||||
derivePath(path: string): BIP32;
|
||||
sign(hash: Buffer): Buffer;
|
||||
verify(hash: Buffer, signature: Buffer): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a node
|
||||
* @param string base58 encoded string
|
||||
* @param network network type of the node
|
||||
*/
|
||||
export function fromBase58(string: string, network?: NetworkType): BIP32;
|
||||
|
||||
/**
|
||||
* Returns a hardened node
|
||||
* @param privateKey node private key
|
||||
* @param chainCode 256-bits entropy extension
|
||||
* @param network network type of the node
|
||||
*/
|
||||
export function fromPrivateKey(privateKey: Buffer, chainCode: Buffer, network?: NetworkType): BIP32;
|
||||
|
||||
/**
|
||||
* Returns a non-hardened node
|
||||
* @param publicKey node public key
|
||||
* @param chainCode 256-bits entropy extension
|
||||
* @param network network type of the node
|
||||
*/
|
||||
export function fromPublicKey(publicKey: Buffer, chainCode: Buffer, network?: NetworkType): BIP32;
|
||||
|
||||
/**
|
||||
* Returns a hardened node
|
||||
* @param seed seed encoding node info
|
||||
* @param network network type of the node
|
||||
*/
|
||||
export function fromSeed(seed: Buffer, network?: NetworkType): BIP32;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bip32-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,4 +1,3 @@
|
||||
import bigi = require('bigi');
|
||||
import bitcoin = require('bitcoinjs-lib');
|
||||
|
||||
// For testing only
|
||||
@@ -8,19 +7,18 @@ function rng() {
|
||||
|
||||
// Generate a random bitcoin address
|
||||
const keyPair1 = bitcoin.ECPair.makeRandom({rng});
|
||||
const address = keyPair1.getAddress();
|
||||
const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair1.publicKey });
|
||||
keyPair1.toWIF();
|
||||
|
||||
// Generate an address from a SHA256 hash
|
||||
const hash = bitcoin.crypto.sha256(Buffer.from('correct horse battery staple', 'utf8'));
|
||||
const d = bigi.fromBuffer(hash);
|
||||
const keyPair2 = new bitcoin.ECPair(d);
|
||||
const keyPair2 = bitcoin.ECPair.fromPrivateKey(hash);
|
||||
|
||||
// Generate a random keypair for alternative networks
|
||||
const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.litecoin, rng});
|
||||
const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.testnet, rng});
|
||||
keyPair3.toWIF();
|
||||
keyPair3.getAddress();
|
||||
const network = keyPair3.getNetwork();
|
||||
bitcoin.payments.p2pkh({ pubkey: keyPair3.publicKey });
|
||||
const network = keyPair3.network;
|
||||
|
||||
// Test TransactionBuilder and Transaction
|
||||
const txb = new bitcoin.TransactionBuilder();
|
||||
@@ -41,22 +39,3 @@ bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version);
|
||||
bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix);
|
||||
bitcoin.address.toOutputScript(address);
|
||||
bitcoin.address.toOutputScript(address, network);
|
||||
|
||||
const redeemScript = bitcoin.script.multisig.output.encode(
|
||||
2,
|
||||
[
|
||||
new Buffer('12345678901234567890123456789012'),
|
||||
new Buffer('12345678901234567890123456789012'),
|
||||
new Buffer('12345678901234567890123456789012'),
|
||||
]
|
||||
);
|
||||
bitcoin.script.scriptHash.input.encode(
|
||||
bitcoin.script.multisig.input.encodeStack(
|
||||
[
|
||||
new Buffer('12345678901234567890123456789012'),
|
||||
new Buffer('12345678901234567890123456789012'),
|
||||
],
|
||||
redeemScript,
|
||||
),
|
||||
redeemScript,
|
||||
);
|
||||
|
||||
Vendored
+48
-138
@@ -1,4 +1,4 @@
|
||||
// Type definitions for bitcoinjs-lib 3.4
|
||||
// Type definitions for bitcoinjs-lib 4.0
|
||||
// Project: https://github.com/bitcoinjs/bitcoinjs-lib
|
||||
// Definitions by: Mohamed Hegazy <https://github.com/mhegazy>
|
||||
// Daniel <https://github.com/dlebrecht>
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import BigInteger = require('bigi');
|
||||
|
||||
export interface Out {
|
||||
script: Buffer;
|
||||
value: number;
|
||||
@@ -68,29 +66,23 @@ export class Block {
|
||||
}
|
||||
|
||||
export class ECPair {
|
||||
constructor(d: BigInteger, Q?: null, options?: { compressed?: boolean, network?: Network });
|
||||
|
||||
constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type
|
||||
|
||||
d: BigInteger;
|
||||
|
||||
readonly compressed: boolean;
|
||||
|
||||
readonly privateKey: Buffer;
|
||||
|
||||
readonly publicKey: Buffer;
|
||||
|
||||
readonly network: Network;
|
||||
|
||||
getAddress(): string;
|
||||
|
||||
getNetwork(): Network;
|
||||
|
||||
getPublicKeyBuffer(): Buffer;
|
||||
|
||||
sign(hash: Buffer): ECSignature;
|
||||
sign(hash: Buffer): Buffer;
|
||||
|
||||
toWIF(): string;
|
||||
|
||||
verify(hash: Buffer, signature: ECSignature): boolean;
|
||||
verify(hash: Buffer, signature: Buffer): boolean;
|
||||
|
||||
static fromPublicKeyBuffer(buffer: Buffer, network: Network): ECPair;
|
||||
static fromPrivateKey(buffer: Buffer, options?: { compressed?: boolean, network?: Network }): ECPair;
|
||||
|
||||
static fromPublicKey(buffer: Buffer, options?: { compressed?: boolean, network?: Network }): ECPair;
|
||||
|
||||
static fromWIF(string: string, network?: Network): ECPair;
|
||||
|
||||
@@ -99,66 +91,6 @@ export class ECPair {
|
||||
|
||||
export type Rng = (size: number) => Buffer;
|
||||
|
||||
export class ECSignature {
|
||||
constructor(r: BigInteger, s: BigInteger);
|
||||
|
||||
toCompact(i: number, compressed: boolean): Buffer;
|
||||
|
||||
toDER(): Buffer;
|
||||
|
||||
toScriptSignature(hashType: number): Buffer;
|
||||
|
||||
static fromDER(buffer: Buffer): ECSignature;
|
||||
|
||||
static parseCompact(buffer: Buffer): { compressed: boolean, i: number, signature: ECSignature };
|
||||
|
||||
static parseScriptSignature(buffer: Buffer): { signature: ECSignature, hashType: number };
|
||||
}
|
||||
|
||||
export class HDNode {
|
||||
constructor(keyPair: ECPair, chainCode: Buffer);
|
||||
|
||||
keyPair: ECPair;
|
||||
|
||||
derive(index: number): HDNode;
|
||||
|
||||
deriveHardened(index: number): HDNode;
|
||||
|
||||
derivePath(path: string): HDNode;
|
||||
|
||||
getAddress(): string;
|
||||
|
||||
getFingerprint(): Buffer;
|
||||
|
||||
getIdentifier(): Buffer;
|
||||
|
||||
getNetwork(): Network;
|
||||
|
||||
getPublicKeyBuffer(): Buffer;
|
||||
|
||||
isNeutered(): boolean;
|
||||
|
||||
neutered(): HDNode;
|
||||
|
||||
sign(hash: Buffer): ECSignature;
|
||||
|
||||
toBase58(): string;
|
||||
|
||||
verify(hash: Buffer, signature: ECSignature): boolean;
|
||||
|
||||
static HIGHEST_BIT: number;
|
||||
|
||||
static LENGTH: number;
|
||||
|
||||
static fromBase58(string: string, networks?: Network[] | Network): HDNode;
|
||||
|
||||
static fromSeedBuffer(seed: Buffer, network?: Network): HDNode;
|
||||
|
||||
static fromSeedHex(hex: string, network?: Network): HDNode;
|
||||
|
||||
static MASTER_SECRET: Buffer;
|
||||
}
|
||||
|
||||
export class Transaction {
|
||||
version: number;
|
||||
locktime: number;
|
||||
@@ -236,9 +168,6 @@ export interface Input {
|
||||
}
|
||||
|
||||
export class TransactionBuilder {
|
||||
tx: Transaction;
|
||||
inputs: Input[];
|
||||
|
||||
constructor(network?: Network, maximumFeeRate?: number);
|
||||
|
||||
addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number;
|
||||
@@ -261,7 +190,6 @@ export class TransactionBuilder {
|
||||
|
||||
export const networks: {
|
||||
bitcoin: Network;
|
||||
litecoin: Network;
|
||||
testnet: Network;
|
||||
};
|
||||
|
||||
@@ -391,7 +319,7 @@ export namespace address {
|
||||
/** @since 3.2.0 */
|
||||
function fromBech32(address: string): { data: Buffer, prefix: string, version: number };
|
||||
|
||||
function fromOutputScript(outputScript: Buffer, network?: Network): string;
|
||||
function fromOutputScript(output: Buffer, network?: Network): string;
|
||||
|
||||
function toBase58Check(hash: Buffer, version: number): string;
|
||||
|
||||
@@ -401,26 +329,6 @@ export namespace address {
|
||||
function toOutputScript(address: string, network?: Network): Buffer;
|
||||
}
|
||||
|
||||
export namespace bufferutils {
|
||||
function pushDataSize(i: number): number;
|
||||
|
||||
function readPushDataInt(buffer: Buffer, offset: number): { opcode: number, number: number, size: number };
|
||||
|
||||
function readUInt64LE(buffer: Buffer, offset: number): number;
|
||||
|
||||
function readVarInt(buffer: Buffer, offset: number): { number: number, size: number };
|
||||
|
||||
function varIntBuffer(number: number, buffer: Buffer, offset: number): Buffer;
|
||||
|
||||
function varIntSize(number: number): number;
|
||||
|
||||
function writePushDataInt(buffer: Buffer, number: number, offset: number): number;
|
||||
|
||||
function writeUInt64LE(buffer: Buffer, value: number, offset: number): number;
|
||||
|
||||
function writeVarInt(buffer: Buffer, number: number, offset: number): number;
|
||||
}
|
||||
|
||||
export namespace crypto {
|
||||
function hash160(buffer: Buffer): Buffer;
|
||||
|
||||
@@ -449,7 +357,7 @@ export namespace script {
|
||||
|
||||
function isCanonicalPubKey(buffer: Buffer): boolean;
|
||||
|
||||
function isCanonicalSignature(buffer: Buffer): boolean;
|
||||
function isCanonicalScriptSignature(buffer: Buffer): boolean;
|
||||
|
||||
function isDefinedHashType(hashType: any): boolean;
|
||||
|
||||
@@ -465,66 +373,48 @@ export namespace script {
|
||||
function encode(number: number): Buffer;
|
||||
}
|
||||
|
||||
namespace signature {
|
||||
function decode(buffer: Buffer): { signature: Buffer, hashType: number };
|
||||
|
||||
function encode(signature: Buffer, hashType: number): Buffer;
|
||||
}
|
||||
|
||||
const multisig: {
|
||||
input: {
|
||||
check(script: Buffer, allowIncomplete: boolean): boolean;
|
||||
decode(buffer: Buffer): Array<Buffer | number>;
|
||||
decodeStack(stack: Buffer[], allowIncomplete: boolean): Array<Buffer | number>;
|
||||
encode(signatures: Buffer[], scriptPubKey: Buffer): Buffer;
|
||||
encodeStack(signatures: Buffer[], scriptPubKey: Buffer): Buffer[];
|
||||
};
|
||||
output: {
|
||||
check(script: Buffer, allowIncomplete: boolean): boolean;
|
||||
decode(buffer: Buffer, allowIncomplete: boolean): { m: number; pubKeys: Array<Buffer | number> };
|
||||
encode(m: number, pubKeys: Array<Buffer | number>): Buffer;
|
||||
};
|
||||
};
|
||||
|
||||
const pubKey: {
|
||||
input: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Array<Buffer | number>;
|
||||
decodeStack(stack: Buffer[]): Array<Buffer | number>;
|
||||
encode(signature: Buffer): Buffer;
|
||||
encodeStack(signature: Buffer): Buffer[];
|
||||
};
|
||||
|
||||
output: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Buffer | number;
|
||||
encode(pubKey: Buffer): Buffer;
|
||||
};
|
||||
};
|
||||
|
||||
const pubKeyHash: {
|
||||
input: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): { signature: Buffer; pubKey: Buffer };
|
||||
decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer };
|
||||
encode(signature: Buffer, pubKey: Buffer): Buffer;
|
||||
encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer];
|
||||
};
|
||||
|
||||
output: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Buffer;
|
||||
encode(pubKeyHash: Buffer): Buffer;
|
||||
};
|
||||
};
|
||||
|
||||
const scriptHash: {
|
||||
input: {
|
||||
check(script: Buffer, allowIncomplete: boolean): boolean;
|
||||
decode(buffer: Buffer): { redeemScriptStack: Buffer[]; redeemScript: Buffer };
|
||||
decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer };
|
||||
encode(redeemScriptSig: Array<Buffer | number>, redeemScript: Buffer): Buffer;
|
||||
encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[];
|
||||
};
|
||||
|
||||
output: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Buffer;
|
||||
encode(scriptHash: Buffer): Buffer;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -539,36 +429,56 @@ export namespace script {
|
||||
const witnessPubKeyHash: {
|
||||
input: {
|
||||
check(script: Buffer): boolean;
|
||||
decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer };
|
||||
encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer];
|
||||
};
|
||||
|
||||
output: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Buffer;
|
||||
encode(pubKeyHash: Buffer): Buffer;
|
||||
};
|
||||
};
|
||||
|
||||
const witnessScriptHash: {
|
||||
input: {
|
||||
check(script: Buffer, allowIncomplete: boolean): boolean;
|
||||
decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer };
|
||||
encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[];
|
||||
};
|
||||
|
||||
output: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Buffer;
|
||||
encode(scriptHash: Buffer): Buffer;
|
||||
};
|
||||
};
|
||||
|
||||
const nullData: {
|
||||
output: {
|
||||
check(script: Buffer): boolean;
|
||||
decode(buffer: Buffer): Buffer;
|
||||
encode(data: Buffer): Buffer;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export namespace payments {
|
||||
function p2data(a: { network?: Network, output?: Buffer, data?: Buffer[] }, opts?: { validate?: boolean }):
|
||||
{ output: Buffer, data: Buffer[] };
|
||||
|
||||
function p2ms(a: { network?: Network, m?: number, n?: number, output?: Buffer, pubkeys?: Buffer[], signatures?: Buffer[], input?: Buffer }, opts?: { validate?: boolean }):
|
||||
{ output: Buffer, m: number, n: number, pubkeys: Buffer[], signatures: Buffer[], input: Buffer, witness: Buffer[] };
|
||||
|
||||
function p2pk(a: { input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer }, opts?: { validate?: boolean }):
|
||||
{ output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] };
|
||||
|
||||
function p2pkh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer }, opts?: { validate?: boolean }):
|
||||
{ address: string, hash: Buffer, output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] };
|
||||
|
||||
function p2sh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, witness?: Buffer[], redeem?: Redeem }, opts?: { validate?: boolean }):
|
||||
{ address: string, hash: Buffer, output: Buffer, redeem: Redeem, input: Buffer, witness: Buffer[] };
|
||||
|
||||
function p2wpkh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, pubkey?: Buffer, signature?: Buffer, witness?: Buffer[] },
|
||||
opts?: { validate?: boolean }): { address: string, hash: Buffer, output: Buffer, pubkey: Buffer, signature: Buffer, input: Buffer, witness: Buffer[] };
|
||||
|
||||
function p2wsh(a: { address?: string, hash?: Buffer, input?: Buffer, network?: Network, output?: Buffer, witness?: Buffer[], redeem?: Redeem }, opts?: { validate?: boolean }):
|
||||
{ address: string, hash: Buffer, output: Buffer, redeem: Redeem, input: Buffer, witness: Buffer[] };
|
||||
|
||||
class Redeem {
|
||||
input?: Buffer;
|
||||
network?: Network;
|
||||
output?: Buffer;
|
||||
witness?: Buffer[];
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function and(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
import bitsAnd from './and';
|
||||
import bitsNor from './nor';
|
||||
import bitsNot from './not';
|
||||
import bitsOr from './or';
|
||||
import bitsReduceAnd from './reduce-and';
|
||||
import bitsReduceNand from './reduce-nand';
|
||||
import bitsReduceNor from './reduce-nor';
|
||||
import bitsReduceOr from './reduce-or';
|
||||
import bitsReduceXnor from './reduce-xnor';
|
||||
import bitsReduceXor from './reduce-xor';
|
||||
import bitsToBoolean from './to-boolean';
|
||||
import bitsToString from './to-string';
|
||||
import bitsXnor from './xnor';
|
||||
import bitsXor from './xor';
|
||||
|
||||
declare namespace bits {
|
||||
const and: typeof bitsAnd;
|
||||
const nor: typeof bitsNor;
|
||||
const not: typeof bitsNot;
|
||||
const or: typeof bitsOr;
|
||||
const reduceAnd: typeof bitsReduceAnd;
|
||||
const reduceNand: typeof bitsReduceNand;
|
||||
const reduceNor: typeof bitsReduceNor;
|
||||
const reduceOr: typeof bitsReduceOr;
|
||||
const reduceXnor: typeof bitsReduceXnor;
|
||||
const reduceXor: typeof bitsReduceXor;
|
||||
const toBoolean: typeof bitsToBoolean;
|
||||
const toString: typeof bitsToString;
|
||||
const xnor: typeof bitsXnor;
|
||||
const xor: typeof bitsXor;
|
||||
}
|
||||
|
||||
export default bits;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function nand(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function nor(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function not(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function or(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function reduceAnd(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function reduceNand(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function reduceNor(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function reduceOr(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function reduceXnor(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function reduceXor(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
export default function toBoolean(
|
||||
bits: ReadonlyArray<number>
|
||||
): ReadonlyArray<boolean>;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
export default function toString(
|
||||
bit: ReadonlyArray<number>,
|
||||
spacing?: number,
|
||||
spacer?: string
|
||||
): string;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function xnor(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default function xor(
|
||||
bits1: ReadonlyArray<number>,
|
||||
bits2: ReadonlyArray<number>
|
||||
): ReadonlyArray<number>;
|
||||
@@ -1,56 +0,0 @@
|
||||
// Demonstrating cherry-picking
|
||||
import bitwise from 'bitwise';
|
||||
|
||||
import bits from 'bitwise/bits';
|
||||
import toBoolean from 'bitwise/bits/to-boolean';
|
||||
|
||||
import buffer from 'bitwise/buffer';
|
||||
import create from 'bitwise/buffer/create';
|
||||
|
||||
import byte from 'bitwise/byte';
|
||||
import read from 'bitwise/byte/read';
|
||||
|
||||
import integer from 'bitwise/integer';
|
||||
import setBit from 'bitwise/integer/set-bit';
|
||||
|
||||
import nibble from 'bitwise/nibble';
|
||||
import nibbleRead from 'bitwise/nibble/read';
|
||||
|
||||
import string from 'bitwise/string';
|
||||
import toBits from 'bitwise/string/to-bits';
|
||||
|
||||
// Testing basic functions
|
||||
const testBits = [0, 1, 1, 0, 1];
|
||||
|
||||
// $ExpectType string
|
||||
bitwise.bits.toString(testBits);
|
||||
|
||||
// $ExpectType ReadonlyArray<boolean>
|
||||
bits.toBoolean(testBits);
|
||||
// $ExpectType ReadonlyArray<boolean>
|
||||
toBoolean(testBits);
|
||||
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
byte.read(12);
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
read(12);
|
||||
|
||||
// $ExpectType Buffer
|
||||
buffer.create(testBits);
|
||||
// $ExpectType Buffer
|
||||
create(testBits);
|
||||
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
integer.setBit(12, 1, 0);
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
setBit(12, 1, 0);
|
||||
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
nibble.read(15);
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
nibbleRead(15);
|
||||
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
string.toBits('10 10 12$%_.0');
|
||||
// $ExpectType ReadonlyArray<number>
|
||||
toBits('10 10 12$%_.0');
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function and(
|
||||
buffer1: Buffer,
|
||||
buffer2: Buffer,
|
||||
isLooping?: boolean
|
||||
): Buffer;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function create(bits: ReadonlyArray<number>): Buffer;
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
import bufferAnd from './and';
|
||||
import bufferCreate from './create';
|
||||
import bufferModify from './modify';
|
||||
import bufferNand from './nand';
|
||||
import bufferNor from './nor';
|
||||
import bufferNot from './not';
|
||||
import bufferOr from './or';
|
||||
import bufferRead from './read';
|
||||
import bufferReadCInt from './read-c-int';
|
||||
import bufferReadInt from './read-int';
|
||||
import bufferReadUInt from './read-u-int';
|
||||
import bufferXnor from './xnor';
|
||||
import bufferXor from './xor';
|
||||
|
||||
declare namespace buffer {
|
||||
const and: typeof bufferAnd;
|
||||
const create: typeof bufferCreate;
|
||||
const modify: typeof bufferModify;
|
||||
const nand: typeof bufferNand;
|
||||
const nor: typeof bufferNor;
|
||||
const not: typeof bufferNot;
|
||||
const or: typeof bufferOr;
|
||||
const read: typeof bufferRead;
|
||||
const readCInt: typeof bufferReadCInt;
|
||||
const readInt: typeof bufferReadInt;
|
||||
const readUInt: typeof bufferReadUInt;
|
||||
const xnor: typeof bufferXnor;
|
||||
const xor: typeof bufferXor;
|
||||
}
|
||||
|
||||
export default buffer;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function modify(
|
||||
buffer: Buffer,
|
||||
newBits: ReadonlyArray<number>,
|
||||
bitOffset?: number
|
||||
): void;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function nand(
|
||||
buffer1: Buffer,
|
||||
buffer2: Buffer,
|
||||
isLooping?: boolean
|
||||
): Buffer;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function nor(
|
||||
buffer1: Buffer,
|
||||
buffer2: Buffer,
|
||||
isLooping: boolean
|
||||
): Buffer;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function not(buffer: Buffer): Buffer;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function or(
|
||||
buffer1: Buffer,
|
||||
buffer2: Buffer,
|
||||
isLooping?: boolean
|
||||
): Buffer;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function readCInt(
|
||||
buffer: Buffer,
|
||||
bitOffset?: number,
|
||||
bitLength?: number
|
||||
): number;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function readInt(
|
||||
buffer: Buffer,
|
||||
bitOffset?: number,
|
||||
bitLength?: number
|
||||
): number;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function readUInt(
|
||||
buffer: Buffer,
|
||||
bitOffset?: number,
|
||||
bitLength?: number
|
||||
): number;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function read(
|
||||
buffer: Buffer,
|
||||
bitOffset?: number,
|
||||
bitLength?: number
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function xnor(
|
||||
buffer1: Buffer,
|
||||
buffer2: Buffer,
|
||||
isLooping?: boolean
|
||||
): Buffer;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
/// <reference types= "node" />
|
||||
|
||||
export default function xor(
|
||||
buffer1: Buffer,
|
||||
buffer2: Buffer,
|
||||
isLooping?: boolean
|
||||
): Buffer;
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
import byteRead from './read';
|
||||
import byteWrite from './write';
|
||||
|
||||
declare namespace byte {
|
||||
const read: typeof byteRead;
|
||||
const write: typeof byteWrite;
|
||||
}
|
||||
|
||||
export default byte;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function read(byte: number): ReadonlyArray<number>;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function write(bits: ReadonlyArray<number>): number;
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
// Type definitions for bitwise 1.5
|
||||
// Project: https://github.com/dodekeract/bitwise
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import bitwiseBits from './bits';
|
||||
import bitwiseBuffer from './buffer';
|
||||
import bitwiseByte from './byte';
|
||||
import bitwiseInteger from './integer';
|
||||
import bitwiseNibble from './nibble';
|
||||
import bitwiseString from './string';
|
||||
|
||||
declare namespace bitwise {
|
||||
const bits: typeof bitwiseBits;
|
||||
const buffer: typeof bitwiseBuffer;
|
||||
const byte: typeof bitwiseByte;
|
||||
const integer: typeof bitwiseInteger;
|
||||
const nibble: typeof bitwiseNibble;
|
||||
const string: typeof bitwiseString;
|
||||
}
|
||||
|
||||
export default bitwise;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function getBit(number: number, position: number): number;
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
import integerGetBit from './get-bit';
|
||||
import integerSetBit from './set-bit';
|
||||
import integerToggleBit from './toggle-bit';
|
||||
|
||||
declare namespace integer {
|
||||
const getBit: typeof integerGetBit;
|
||||
const setBit: typeof integerSetBit;
|
||||
const toggleBit: typeof integerToggleBit;
|
||||
}
|
||||
|
||||
export default integer;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
export default function setBit(
|
||||
number: number,
|
||||
position: number,
|
||||
value: number
|
||||
): ReadonlyArray<number>;
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
export default function toggleBit(
|
||||
number: number,
|
||||
position: number
|
||||
): ReadonlyArray<number>;
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
import nibbleRead from './read';
|
||||
import nibbleWrite from './write';
|
||||
|
||||
declare namespace nibble {
|
||||
const read: typeof nibbleRead;
|
||||
const write: typeof nibbleWrite;
|
||||
}
|
||||
|
||||
export default nibble;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function read(nibble: number): ReadonlyArray<number>;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function write(nibble: ReadonlyArray<number>): number;
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
import stringToBits from './to-bits';
|
||||
|
||||
declare namespace string {
|
||||
const toBits: typeof stringToBits;
|
||||
}
|
||||
|
||||
export default string;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function toBits(string: string): ReadonlyArray<number>;
|
||||
@@ -1,60 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bitwise-tests.ts",
|
||||
"bits/and.d.ts",
|
||||
"bits/index.d.ts",
|
||||
"bits/nand.d.ts",
|
||||
"bits/nor.d.ts",
|
||||
"bits/not.d.ts",
|
||||
"bits/or.d.ts",
|
||||
"bits/reduce-and.d.ts",
|
||||
"bits/reduce-nand.d.ts",
|
||||
"bits/reduce-nor.d.ts",
|
||||
"bits/reduce-or.d.ts",
|
||||
"bits/reduce-xnor.d.ts",
|
||||
"bits/reduce-xor.d.ts",
|
||||
"bits/to-boolean.d.ts",
|
||||
"bits/to-string.d.ts",
|
||||
"bits/xnor.d.ts",
|
||||
"bits/xor.d.ts",
|
||||
"buffer/and.d.ts",
|
||||
"buffer/create.d.ts",
|
||||
"buffer/modify.d.ts",
|
||||
"buffer/nand.d.ts",
|
||||
"buffer/nor.d.ts",
|
||||
"buffer/not.d.ts",
|
||||
"buffer/or.d.ts",
|
||||
"buffer/read-c-int.d.ts",
|
||||
"buffer/read-int.d.ts",
|
||||
"buffer/read-u-int.d.ts",
|
||||
"buffer/read.d.ts",
|
||||
"buffer/xnor.d.ts",
|
||||
"buffer/xor.d.ts",
|
||||
"byte/index.d.ts",
|
||||
"byte/read.d.ts",
|
||||
"byte/write.d.ts",
|
||||
"integer/get-bit.d.ts",
|
||||
"integer/index.d.ts",
|
||||
"integer/set-bit.d.ts",
|
||||
"integer/toggle-bit.d.ts",
|
||||
"nibble/index.d.ts",
|
||||
"nibble/read.d.ts",
|
||||
"nibble/write.d.ts",
|
||||
"string/index.d.ts",
|
||||
"string/to-bits.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import BloomFilter = require('bloom-filter');
|
||||
|
||||
const numElements = 3;
|
||||
const falsePositiveRate = 0.01;
|
||||
const filter = BloomFilter.create(numElements, falsePositiveRate);
|
||||
|
||||
// elements
|
||||
const a = Buffer.from('99108ad8ed9bb6274d3980bab5a85c048f0950c8', 'hex');
|
||||
const c = Buffer.from('b5a2c786d9ef4658287ced5914b37a1b4aa32eee', 'hex');
|
||||
|
||||
// insert elements
|
||||
// $ExpectType void
|
||||
filter.insert(a);
|
||||
|
||||
// $ExpectType boolean
|
||||
!filter.contains(c);
|
||||
|
||||
// reinstantiate from an object
|
||||
const serialized = filter.toObject();
|
||||
const woahFilter = new BloomFilter(serialized);
|
||||
|
||||
// initialize directly
|
||||
const newFilter = new BloomFilter({
|
||||
vData: Buffer.from('123', 'hex'), // the data of the filter
|
||||
nHashFuncs: 3, // the number of hash functions to use
|
||||
nTweak: 2147483649, // the seed used for the hash fuctions
|
||||
nFlags: 0 // flags used to update the filter when matched
|
||||
});
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for bloom-filter 0.2
|
||||
// Project: https://github.com/bitpay/bloom-filter
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare class Filter {
|
||||
constructor(options: Filter.FilterOptions);
|
||||
static create(elements: number, falsePositiveRate: number, nTweak?: number, nFlags?: number): Filter;
|
||||
toObject(): Filter.FilterOptions;
|
||||
hash(nHashNum: number, vDataToHash: Buffer): number;
|
||||
insert(data: Buffer): void;
|
||||
contains(data: Buffer): boolean;
|
||||
clear(): void;
|
||||
inspect(): string;
|
||||
BLOOM_UPDATE_NONE: number;
|
||||
BLOOM_UPDATE_ALL: number;
|
||||
BLOOM_UPDATE_P2PUBKEY_ONLY: number;
|
||||
MAX_BLOOM_FILTER_SIZE: number;
|
||||
MAX_HASH_FUNCS: number;
|
||||
MIN_HASH_FUNCS: number;
|
||||
LN2SQUARED: number;
|
||||
LN2: number;
|
||||
}
|
||||
|
||||
declare namespace Filter {
|
||||
interface FilterOptions {
|
||||
vData: Buffer;
|
||||
nHashFuncs: number;
|
||||
nTweak?: number;
|
||||
nFlags?: number;
|
||||
}
|
||||
|
||||
function MurmurHash3(seed: number, data: Buffer): number;
|
||||
}
|
||||
|
||||
export = Filter;
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bloom-filter-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -5,3 +5,6 @@ let bn = new BN(42);
|
||||
bn = bn.add(bn);
|
||||
bn.isZero();
|
||||
bn.byteLength;
|
||||
|
||||
bn.toArrayLike(Buffer, 'le', 2);
|
||||
const test = new BN(1, 'le');
|
||||
|
||||
Vendored
+22
-2
@@ -48,6 +48,10 @@ declare class BN {
|
||||
base?: number,
|
||||
endian?: Endianness
|
||||
);
|
||||
constructor(
|
||||
number: number | string | number[] | Buffer | BN,
|
||||
endian?: Endianness
|
||||
)
|
||||
|
||||
/**
|
||||
* @description create a reduction context
|
||||
@@ -64,6 +68,16 @@ declare class BN {
|
||||
*/
|
||||
static isBN(b: any): b is BN;
|
||||
|
||||
/**
|
||||
* @description returns the maximum of 2 BN instances.
|
||||
*/
|
||||
static max(left: BN, right: BN): BN;
|
||||
|
||||
/**
|
||||
* @description returns the minimum of 2 BN instances.
|
||||
*/
|
||||
static min(left: BN, right: BN): BN;
|
||||
|
||||
/**
|
||||
* @description Convert number to red
|
||||
*/
|
||||
@@ -98,10 +112,16 @@ declare class BN {
|
||||
* @description convert to an instance of `type`, which must behave like an Array
|
||||
*/
|
||||
toArrayLike(
|
||||
ArrayType: Buffer | any[],
|
||||
ArrayType: typeof Buffer,
|
||||
endian?: Endianness,
|
||||
length?: number
|
||||
): Buffer | any[];
|
||||
): Buffer;
|
||||
|
||||
toArrayLike(
|
||||
ArrayType: any[],
|
||||
endian?: Endianness,
|
||||
length?: number
|
||||
): any[];
|
||||
|
||||
/**
|
||||
* @description convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length)
|
||||
|
||||
@@ -60,3 +60,6 @@ Object.keys(insertGlobals.vars).forEach((x) => {
|
||||
var b = browserify('./browser/main.js', {
|
||||
insertGlobalVars: insertGlobalVars
|
||||
});
|
||||
|
||||
declare const file: string | string[];
|
||||
b.add(file);
|
||||
|
||||
Vendored
+5
-3
@@ -1,6 +1,9 @@
|
||||
// Type definitions for Browserify 12.0
|
||||
// Project: http://browserify.org/
|
||||
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar>, John Vilk <https://github.com/jvilk>, Leonard Thieu <https://github.com/leonard-thieu>
|
||||
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar>
|
||||
// John Vilk <https://github.com/jvilk>
|
||||
// Leonard Thieu <https://github.com/leonard-thieu>
|
||||
// Linus Unnebäck <https://github.com/LinusU>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -102,8 +105,7 @@ interface BrowserifyObject extends NodeJS.EventEmitter {
|
||||
* Add an entry file from file that will be executed when the bundle loads.
|
||||
* If file is an array, each item in file will be added as an entry file.
|
||||
*/
|
||||
add(file: InputFile[], opts?: FileOptions): BrowserifyObject;
|
||||
add(file: InputFile, opts?: FileOptions): BrowserifyObject;
|
||||
add(file: InputFile | InputFile[], opts?: FileOptions): BrowserifyObject;
|
||||
/**
|
||||
* Make file available from outside the bundle with require(file).
|
||||
* The file param is anything that can be resolved by require.resolve().
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import bytewise = require('bytewise');
|
||||
|
||||
// $ExpectType Buffer
|
||||
bytewise.encode([1, 2, 3]);
|
||||
|
||||
// $ExpectType any
|
||||
bytewise.decode(bytewise.encode([1, 2 , 3]));
|
||||
|
||||
// $ExpectType Buffer
|
||||
bytewise.encode(bytewise.sorts.array.bound.lower(['123', -1, 0x123, Buffer.from('test')]));
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for bytewise 1.1
|
||||
// Project: https://github.com/deanlandolt/bytewise
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types= "node" />
|
||||
|
||||
interface Bytewise {
|
||||
encode: (value: any) => Buffer;
|
||||
decode: (value: Buffer) => any;
|
||||
[k: string]: any;
|
||||
}
|
||||
|
||||
declare const bytewise: Bytewise;
|
||||
export = bytewise;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bytewise-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+7
@@ -454,6 +454,13 @@ declare module CANNON {
|
||||
type?: number;
|
||||
linearDamping?: number;
|
||||
angularDamping?: number;
|
||||
allowSleep?: boolean;
|
||||
sleepSpeedLimit?: number;
|
||||
sleepTimeLimit?: number;
|
||||
collisionFilterGroup?: number;
|
||||
collisionFilterMask?: number;
|
||||
fixedRotation?: boolean;
|
||||
shape?: Shape;
|
||||
}
|
||||
|
||||
export class Body extends EventTarget {
|
||||
|
||||
Vendored
+22
-3
@@ -797,6 +797,22 @@ declare namespace Cesium {
|
||||
isLeapSecond: boolean;
|
||||
}
|
||||
|
||||
class HeadingPitchRoll {
|
||||
heading: number;
|
||||
pitch: number;
|
||||
roll: number;
|
||||
constructor(heading?: number, pitch?: number, roll?: number);
|
||||
static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
|
||||
static equals(left: HeadingPitchRoll | null | undefined, right: HeadingPitchRoll | null | undefined): boolean;
|
||||
static equalsEpsilon(left: HeadingPitchRoll | null | undefined, right: HeadingPitchRoll | null | undefined, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
|
||||
static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
|
||||
static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
|
||||
clone(result?: HeadingPitchRoll): HeadingPitchRoll;
|
||||
equals(right: HeadingPitchRoll | null | undefined): boolean;
|
||||
equalsEpsilon(right: HeadingPitchRoll | null | undefined, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
class HeightmapTerrainData {
|
||||
waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
|
||||
constructor(options: {
|
||||
@@ -959,6 +975,7 @@ declare namespace Cesium {
|
||||
static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
|
||||
static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
|
||||
static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
|
||||
static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
|
||||
static fromQuaternion(quaternion: Quaternion): Matrix3;
|
||||
static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
|
||||
static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
|
||||
@@ -1236,7 +1253,7 @@ declare namespace Cesium {
|
||||
toString(): string;
|
||||
static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
|
||||
static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
|
||||
static fromHeadingPitchRoll(heading: number, pitch: number, roll: number, result: Quaternion): Quaternion;
|
||||
static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
|
||||
static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
|
||||
static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
|
||||
static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
|
||||
@@ -4880,13 +4897,15 @@ declare namespace Cesium {
|
||||
function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
|
||||
function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
|
||||
function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
|
||||
function headingPitchRollToFixedFrame(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
|
||||
function headingPitchRollQuaternion(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Quaternion): Quaternion;
|
||||
function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
|
||||
function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: LocalFrameToFixedFrame,
|
||||
result?: Quaternion): Quaternion;
|
||||
function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
|
||||
function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
|
||||
function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
|
||||
function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
|
||||
function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
|
||||
type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
|
||||
}
|
||||
|
||||
namespace TridiagonalSystemSolver {
|
||||
|
||||
@@ -46,3 +46,7 @@ const entity = new Cesium.Entity({
|
||||
})
|
||||
});
|
||||
viewer.entities.add(entity);
|
||||
|
||||
const hpr = new Cesium.HeadingPitchRoll(1.0, 2.2, 3.4);
|
||||
const quat: Cesium.Quaternion = Cesium.Quaternion.fromHeadingPitchRoll(hpr);
|
||||
const matrix: Cesium.Matrix3 = Cesium.Matrix3.fromHeadingPitchRoll(hpr);
|
||||
|
||||
@@ -48,3 +48,7 @@ const entity = new Cesium.Entity({
|
||||
})
|
||||
});
|
||||
viewer.entities.add(entity);
|
||||
|
||||
const hpr = new Cesium.HeadingPitchRoll(1.0, 2.2, 3.4);
|
||||
const quat: Cesium.Quaternion = Cesium.Quaternion.fromHeadingPitchRoll(hpr);
|
||||
const matrix: Cesium.Matrix3 = Cesium.Matrix3.fromHeadingPitchRoll(hpr);
|
||||
|
||||
@@ -13,6 +13,7 @@ function test() {
|
||||
expect(testElement).to.have.id('id');
|
||||
expect(testElement).to.have.html('foo');
|
||||
expect(testElement).to.have.text('foo');
|
||||
expect(testElement).to.have.trimmed.text('foo');
|
||||
expect(testElement).to.have.text(['foo', 'bar']);
|
||||
expect(testElement).to.have.value('foo');
|
||||
expect(testElement).to.be.empty;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user