0.7.0 • Published 3 months ago

kirby-types v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

kirby-types

NPM version

A collection of TypeScript types to work with Kirby CMS, mainly in the context of the Kirby Query Language and headless Kirby usage.

Setup

# pnpm
pnpm add -D kirby-types

# npm
npm i -D kirby-types

# yarn
yarn add -D kirby-types

Basic Usage

import type { KirbyQuery } from "kirby-types";

// Strictly typed query
const query: KirbyQuery = 'page.children.filterBy("featured", true)';

// Invalid queries will throw a type error
let invalidQuery: KirbyQuery;
invalidQuery = "unknown"; // Not a valid model
invalidQuery = 'site("'; // Empty parentheses
invalidQuery = 'site("value"'; // Missing closing parenthesis

API

By clicking on a type name, you will be redirected to the corresponding TypeScript definition file.

API

Query

Blocks

Layout

KQL

License

MIT License © 2022-PRESENT Johann Schopplich

0.7.0

3 months ago

0.6.6

5 months ago

0.6.5

7 months ago

0.6.3

7 months ago

0.6.4

7 months ago

0.6.2

8 months ago

0.6.1

8 months ago

0.6.0

9 months ago

0.5.0

9 months ago