Skip to main content

Call Signature

Create a schedule definition. Returns an immutable Schedule that can be composed via .with() and solved via .solve().

Type Parameters

R

R extends readonly string[]

S

S extends readonly string[] = readonly []

T

T extends Record<string, SemanticTimeEntry> = Record<string, SemanticTimeEntry>

TRules

TRules extends readonly unknown[] = readonly ScheduleRuleEntry<BuiltInCpsatRuleRegistry>[]

Parameters

config

BuiltInScheduleConfigInput<R, S, T, TRules>

Returns

Schedule<BuiltInCpsatRuleRegistry, ShapeFromScheduleParts<R, S, T, NoInfer<CoverageEntry<keyof T & string, R[number] | S[number]>>[]>>

Remarks

schedule() always uses the built-in rule registry as its default. Passing ruleRegistry extends that default with custom rules.

Example

Call Signature

Create a schedule definition. Returns an immutable Schedule that can be composed via .with() and solved via .solve().

Type Parameters

R

R extends readonly string[]

S

S extends readonly string[] = readonly []

T

T extends Record<string, SemanticTimeEntry> = Record<string, SemanticTimeEntry>

TCustomRuleRegistry

TCustomRuleRegistry extends CpsatRuleRegistry = CpsatRuleRegistry

TRules

TRules extends readonly unknown[] = readonly ScheduleRuleEntry<BuiltInCpsatRuleRegistry & TCustomRuleRegistry>[]

Parameters

config

CustomScheduleConfigInput<R, S, T, TCustomRuleRegistry, TRules>

Returns

Schedule<BuiltInCpsatRuleRegistry & TCustomRuleRegistry, ShapeFromScheduleParts<R, S, T, NoInfer<CoverageEntry<keyof T & string, R[number] | S[number]>>[]>>

Remarks

schedule() always uses the built-in rule registry as its default. Passing ruleRegistry extends that default with custom rules.

Example