mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Not use es6-promise in kefir.d.ts
This commit is contained in:
parent
09e37435ff
commit
d70546472a
@ -48,7 +48,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke
|
||||
{
|
||||
let property01: Property<number, void> = Kefir.constant(1);
|
||||
let property02: Property<void, number> = Kefir.constantError(1);
|
||||
let property03: Property<number, void> = Kefir.fromPromise<number, void>(new Promise<number>(fulfill => fulfill(1)));
|
||||
//let property03: Property<number, void> = Kefir.fromPromise<number, void>(new Promise<number>(fulfill => fulfill(1)));
|
||||
}
|
||||
|
||||
// Convert observables
|
||||
@ -69,7 +69,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke
|
||||
Kefir.sequentially(1000, [1, 2]).offAny(event => console.log('event:', event));
|
||||
Kefir.sequentially(1000, [1, 2]).log('my stream');
|
||||
Kefir.sequentially(1000, [1, 2]).offLog('my stream');
|
||||
Kefir.sequentially(1000, [1, 2]).toPromise().then(x => console.log('fulfilled with:', x));
|
||||
Kefir.sequentially(1000, [1, 2]).toPromise().then((x: number) => console.log('fulfilled with:', x));
|
||||
}
|
||||
|
||||
// Modify an observable
|
||||
|
||||
6
kefir/kefir.d.ts
vendored
6
kefir/kefir.d.ts
vendored
@ -4,9 +4,9 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts" />
|
||||
|
||||
declare module "kefir" {
|
||||
|
||||
export interface Observable<T, S> {
|
||||
// Subscribe / add side effects
|
||||
onValue(callback: (value: T) => void): void;
|
||||
@ -19,7 +19,7 @@ declare module "kefir" {
|
||||
offAny(callback: (event: Event<T | S>) => void): void;
|
||||
log(name?: string): void;
|
||||
offLog(name?: string): void;
|
||||
toPromise(PromiseConstructor?: typeof Promise): Promise<T>;
|
||||
toPromise(PromiseConstructor?: any): any;
|
||||
}
|
||||
|
||||
export interface Stream<T, S> extends Observable<T, S> {
|
||||
@ -163,7 +163,7 @@ declare module "kefir" {
|
||||
// Create a property
|
||||
export function constant<T>(value: T): Property<T, void>;
|
||||
export function constantError<T>(error: T): Property<void, T>;
|
||||
export function fromPromise<T, S>(promise: Promise<T>): Property<T, S>;
|
||||
export function fromPromise<T, S>(promise: any): Property<T, S>;
|
||||
|
||||
// Combine observables
|
||||
export function combine<T, S, U>(obss: Observable<T, S>[], passiveObss: Observable<T, S>[], combinator?: (...values: T[]) => U): Observable<U, S>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user