UNPKG

@optimizely/optimizely-sdk

Version:

JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts

18 lines (17 loc) 766 B
import { OpType, OpValue } from '../type'; import { Platform } from '../../platform_support'; /** * A class that wraps a value that can be either a synchronous value or a promise and provides * a promise like interface. This class is used to handle both synchronous and asynchronous values * in a uniform way. */ export declare class Value<OP extends OpType, V> { op: OP; val: OpValue<OP, V>; constructor(op: OP, val: OpValue<OP, V>); get(): OpValue<OP, V>; then<NV>(fn: (v: V) => Value<OP, NV>): Value<OP, NV>; static all: <OP_1 extends OpType, V_1>(op: OP_1, vals: Value<OP_1, V_1>[]) => Value<OP_1, V_1[]>; static of<OP extends OpType, V>(op: OP, val: V | Promise<V>): Value<OP, V>; } export declare const __platforms: Platform[];