@launchdarkly/js-sdk-common
Version:
LaunchDarkly SDK for JavaScript - common code
43 lines • 1.38 kB
TypeScript
import { PayloadProcessor } from './payloadProcessor';
interface fdv1Payload {
flags: {
[name: string]: any;
};
segments: {
[name: string]: any;
};
}
/**
* The FDv1PayloadAdaptor is a helper class that converts FDv1 payloads into events that the PayloadProcessor can understand.
*/
export interface FDv1PayloadAdaptor {
/**
* The PayloadProcessor that will be used to process the events.
*/
readonly _processor: PayloadProcessor;
/**
* The selector that will be used to identify the payload.
*/
_selector: string;
/**
* The method that will be used to set a selector for the payload that is
* being processed.
*
* @remarks
* This method probably shouldn't be used in most instances as FDv1 payloads
* do not have the concept of a selector.
*
* @param selector - The selector to set for the payload.
* @returns this FDv1PayloadAdaptor instance
*/
useSelector: (selector: string) => FDv1PayloadAdaptor;
/**
* The method that will be used to process a full transfer changeset.
*
* @param data - The data to process.
*/
processFullTransfer: (data: fdv1Payload) => void;
}
export declare function fdv1PayloadAdaptor(processor: PayloadProcessor): FDv1PayloadAdaptor;
export {};
//# sourceMappingURL=FDv1PayloadAdaptor.d.ts.map