UNPKG

1.32 kBTypeScriptView Raw
1/**
2 * Type used to strongly type instances of depth identifier while keeping internals
3 * what they contain internally
4 *
5 * @remarks Since 2.25.0
6 * @public
7 */
8export type DepthIdentifier = {} & DepthContext;
9/**
10 * Instance of depth, can be used to alter the depth perceived by an arbitrary
11 * or to bias your own arbitraries based on the current depth
12 *
13 * @remarks Since 2.25.0
14 * @public
15 */
16export type DepthContext = {
17 /**
18 * Current depth (starts at 0, continues with 1, 2...).
19 * Only made of integer values superior or equal to 0.
20 *
21 * Remark: Whenever altering the `depth` during a `generate`, please make sure to ALWAYS
22 * reset it to its original value before you leave the `generate`. Otherwise the execution
23 * will imply side-effects that will potentially impact the following runs and make replay
24 * of the issue barely impossible.
25 */
26 depth: number;
27};
28/**
29 * Get back the requested DepthContext
30 * @remarks Since 2.25.0
31 * @public
32 */
33export declare function getDepthContextFor(contextMeta: DepthContext | DepthIdentifier | string | undefined): DepthContext;
34/**
35 * Create a new and unique instance of DepthIdentifier
36 * that can be shared across multiple arbitraries if needed
37 * @public
38 */
39export declare function createDepthIdentifier(): DepthIdentifier;