1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { JsonValue } from '../../json';
|
---|
9 | import { JobDescription, JobHandler } from './api';
|
---|
10 | export declare namespace strategy {
|
---|
11 | type JobStrategy<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue> = (handler: JobHandler<A, I, O>, options?: Partial<Readonly<JobDescription>>) => JobHandler<A, I, O>;
|
---|
12 | /**
|
---|
13 | * Creates a JobStrategy that serializes every call. This strategy can be mixed between jobs.
|
---|
14 | */
|
---|
15 | function serialize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(): JobStrategy<A, I, O>;
|
---|
16 | /**
|
---|
17 | * Creates a JobStrategy that will always reuse a running job, and restart it if the job ended.
|
---|
18 | * @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
|
---|
19 | * is.
|
---|
20 | */
|
---|
21 | function reuse<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
|
---|
22 | /**
|
---|
23 | * Creates a JobStrategy that will reuse a running job if the argument matches.
|
---|
24 | * @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
|
---|
25 | * is.
|
---|
26 | */
|
---|
27 | function memoize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
|
---|
28 | }
|
---|