# AllExtend

`type` in `services` · v0.7.1

<https://docs.seedcord.org/packages/services/0.7.1/types/all-extend-2>

Returns a boolean for whether every element in an array type extends another type.

## Examples

```ts
import type {AllExtend} from 'type-fest';

type A = AllExtend<[1, 2, 3], number>;
//=> true

type B = AllExtend<[1, 2, '3'], number>;
//=> false

type C = AllExtend<[number, number | string], number>;
//=> boolean

type D = AllExtend<[true, boolean, true], true>;
//=> boolean

Note: Behaviour of optional elements depend on the exactOptionalPropertyTypes compiler option. When the option is disabled, the target type must include undefined for a successful match.

// @exactOptionalPropertyTypes: true
import type {AllExtend} from 'type-fest';

type A = AllExtend<[1?, 2?, 3?], number>;
//=> true

// @exactOptionalPropertyTypes: false
import type {AllExtend} from 'type-fest';

type A = AllExtend<[1?, 2?, 3?], number>;
//=> boolean

type B = AllExtend<[1?, 2?, 3?], number | undefined>;
//=> true
```

## Declaration

```ts
type AllExtend<
    TArray extends UnknownArray,
    Type,
    Options extends AllExtendOptions = {}
> = _AllExtend<
    CollapseRestElement<TArray>,
    Type,
    ApplyDefaultOptions<AllExtendOptions, DefaultAllExtendOptions, Options>
>;
```

## See also

- AllExtendOptions
- Utilities   Array
