# createStaticLayerCatalogue

A [`LayerCatalogue`](https://docs.mapcairn.com/api/core/LayerCatalogue.md) over definitions that are known when the app is
built. It is ready on the first read, on the server and in the browser, and
never changes. Each definition is validated against the decoders and
formatters the host registers, so a broken definition fails when the app
starts, with every problem named, rather than when someone turns the layer
on.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { createStaticLayerCatalogue } from "@mapcairn/core";
 
function createStaticLayerCatalogue(definitions: readonly LayerDefinition[], options: ValidationOptions): LayerCatalogue;
```

## Parameters

- `definitions` (`readonly LayerDefinition[]`)
- `options` (`ValidationOptions`)

## Returns

`LayerCatalogue`

## Throws

- An error listing every problem, each prefixed with its layer id.
   Use `createRuntimeLayerCatalogue` for definitions that can be wrong
   without stopping the app.

## See also

- [`LayerDefinition`](https://docs.mapcairn.com/api/core/LayerDefinition.md)
- [`ValidationOptions`](https://docs.mapcairn.com/api/core/ValidationOptions.md)
- [`LayerCatalogue`](https://docs.mapcairn.com/api/core/LayerCatalogue.md)

Source: [packages/core/src/layers/staticLayerCatalogue.ts:20](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/layers/staticLayerCatalogue.ts#L20)
