> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# partialSchedule

## Call Signature

```ts theme={null}
function partialSchedule<TRules, Config>(config): Schedule<BuiltInCpsatRuleRegistry, ShapeFromPartialConfig<Config>>;
```

Create a partial schedule for composition via `.with()`.

Unlike [schedule](schedule), all fields are optional. Use this for
schedule fragments that layer rules, coverage, or other config onto a
complete base schedule. The returned value is still a [Schedule](./Schedule)
to preserve the existing public API.

TODO: Revisit the public type names for schedule fragments. The current
`Schedule` return type is a workable compromise, but it can obscure that
`partialSchedule()` creates a fragment that may require later declarations.

### Type Parameters

#### TRules

`TRules` *extends* readonly `unknown`\[] = readonly \[]

#### Config

`Config` *extends* `BuiltInPartialScheduleConfigInput`\<`TRules`> = `BuiltInPartialScheduleConfigInput`\<`TRules`>

### Parameters

#### config

`Config` & `object`

### Returns

[`Schedule`](./Schedule)\<`BuiltInCpsatRuleRegistry`, `ShapeFromPartialConfig`\<`Config`>>

### Example

```typescript theme={null}
const companyPolicy = partialSchedule({
  rules: [maxHoursPerWeek(40), minRestBetweenShifts(11)],
});

const ready = venue.with(companyPolicy, teamMembers);
```

## Call Signature

```ts theme={null}
function partialSchedule<TCustomRuleRegistry, TRules, Config>(config): Schedule<BuiltInCpsatRuleRegistry & TCustomRuleRegistry, ShapeFromPartialConfig<Config>>;
```

Create a partial schedule for composition via `.with()`.

Unlike [schedule](schedule), all fields are optional. Use this for
schedule fragments that layer rules, coverage, or other config onto a
complete base schedule. The returned value is still a [Schedule](./Schedule)
to preserve the existing public API.

TODO: Revisit the public type names for schedule fragments. The current
`Schedule` return type is a workable compromise, but it can obscure that
`partialSchedule()` creates a fragment that may require later declarations.

### Type Parameters

#### TCustomRuleRegistry

`TCustomRuleRegistry` *extends* `CpsatRuleRegistry`

#### TRules

`TRules` *extends* readonly `unknown`\[] = readonly \[]

#### Config

`Config` *extends* `CustomPartialScheduleConfigInput`\<`TCustomRuleRegistry`, `TRules`> = `CustomPartialScheduleConfigInput`\<`TCustomRuleRegistry`, `TRules`>

### Parameters

#### config

`Config` & `object`

### Returns

[`Schedule`](./Schedule)\<`BuiltInCpsatRuleRegistry` & `TCustomRuleRegistry`, `ShapeFromPartialConfig`\<`Config`>>

### Example

```typescript theme={null}
const companyPolicy = partialSchedule({
  rules: [maxHoursPerWeek(40), minRestBetweenShifts(11)],
});

const ready = venue.with(companyPolicy, teamMembers);
```
