Skip to content

Commit ca34e9d

Browse files
committed
chore: gen docs
1 parent aa71f35 commit ca34e9d

File tree

36 files changed

+12576
-523
lines changed

36 files changed

+12576
-523
lines changed

docs/.generated/interface-model.json

Lines changed: 6380 additions & 218 deletions
Large diffs are not rendered by default.

docs/.vitepress/config.ts

Lines changed: 71 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -14,88 +14,77 @@ export default defineConfig({
1414
{ text: 'API', link: '/api/' },
1515
],
1616

17-
sidebar: [
18-
{
19-
text: 'Introduction',
20-
items: [
21-
{ text: 'Getting Started', link: '/guide/' },
22-
{ text: 'Installation', link: '/guide/installation' },
23-
{ text: 'Philosophy', link: '/guide/philosophy' },
24-
],
25-
},
26-
{
27-
text: 'Core Concepts',
28-
items: [
29-
{ text: 'Module Structure', link: '/guide/module-structure' },
30-
{ text: 'Currying Pattern', link: '/guide/currying' },
31-
{ text: 'Type Safety', link: '/guide/type-safety' },
32-
],
33-
},
34-
{
35-
text: 'API Reference',
36-
items: [
37-
{
38-
text: 'Data Structures',
39-
collapsed: false,
40-
items: [
41-
{ text: 'Array (arr)', link: '/api/arr' },
42-
{ text: 'Object (obj)', link: '/api/obj' },
43-
{ text: 'String (str)', link: '/api/str' },
44-
{ text: 'Record (rec)', link: '/api/rec' },
45-
{ text: 'Group', link: '/api/group' },
46-
{ text: 'Index (idx)', link: '/api/idx' },
47-
{ text: 'Tree', link: '/api/tree' },
48-
],
49-
},
50-
{
51-
text: 'Functional Programming',
52-
collapsed: false,
53-
items: [
54-
{ text: 'Function (fn)', link: '/api/fn' },
55-
{ text: 'Promise (prom)', link: '/api/prom' },
56-
{ text: 'Cache', link: '/api/cache' },
57-
],
58-
},
59-
{
60-
text: 'Type/Value',
61-
collapsed: false,
62-
items: [
63-
{ text: 'Boolean (bool)', link: '/api/bool' },
64-
{ text: 'Number (num)', link: '/api/num' },
65-
{ text: 'Null', link: '/api/null' },
66-
{ text: 'Undefined', link: '/api/undefined' },
67-
{ text: 'Value', link: '/api/value' },
68-
{ text: 'Equality (eq)', link: '/api/eq' },
69-
],
70-
},
71-
{
72-
text: 'I/O & External',
73-
collapsed: false,
74-
items: [
75-
{ text: 'File System (fs)', link: '/api/fs' },
76-
{ text: 'FS Layout', link: '/api/fs-layout' },
77-
{ text: 'FS Relative', link: '/api/fs-relative' },
78-
{ text: 'HTTP', link: '/api/http' },
79-
{ text: 'CLI', link: '/api/cli' },
80-
{ text: 'URL', link: '/api/url' },
81-
{ text: 'Path', link: '/api/path' },
82-
],
83-
},
84-
{
85-
text: 'Development',
86-
collapsed: false,
87-
items: [
88-
{ text: 'Debug', link: '/api/debug' },
89-
{ text: 'TypeScript (ts)', link: '/api/ts' },
90-
{ text: 'Language', link: '/api/language' },
91-
{ text: 'Codec', link: '/api/codec' },
92-
{ text: 'JSON', link: '/api/json' },
93-
{ text: 'Error (err)', link: '/api/err' },
94-
],
95-
},
96-
],
97-
},
98-
],
17+
outline: {
18+
level: [2, 3], // Show h2 and h3 headings in the outline
19+
},
20+
21+
sidebar: {
22+
// Guide sidebar
23+
'/guide/': [
24+
{
25+
text: 'Introduction',
26+
items: [
27+
{ text: 'Getting Started', link: '/guide/' },
28+
{ text: 'Installation', link: '/guide/installation' },
29+
{ text: 'Philosophy', link: '/guide/philosophy' },
30+
],
31+
},
32+
{
33+
text: 'Core Concepts',
34+
items: [
35+
{ text: 'Module Structure', link: '/guide/module-structure' },
36+
{ text: 'Currying Pattern', link: '/guide/currying' },
37+
{ text: 'Type Safety', link: '/guide/type-safety' },
38+
],
39+
},
40+
],
41+
42+
// API sidebar
43+
'/api/': [
44+
{
45+
text: 'API Reference',
46+
items: [
47+
{ text: 'Overview', link: '/api/' },
48+
],
49+
},
50+
{
51+
text: 'Core Data Structures',
52+
items: [
53+
{ text: 'Arr', link: '/api/arr' },
54+
{ text: 'Obj', link: '/api/obj' },
55+
{ text: 'Str', link: '/api/str' },
56+
{ text: 'Fn', link: '/api/fn' },
57+
{ text: 'Num', link: '/api/num' },
58+
],
59+
},
60+
{
61+
text: 'Utilities',
62+
items: [
63+
{ text: 'Err', link: '/api/err' },
64+
{ text: 'Prom', link: '/api/prom' },
65+
{ text: 'Rec', link: '/api/rec' },
66+
{ text: 'Json', link: '/api/json' },
67+
{ text: 'Value', link: '/api/value' },
68+
],
69+
},
70+
{
71+
text: 'Development',
72+
items: [
73+
{ text: 'Test', link: '/api/test' },
74+
{
75+
text: 'Ts',
76+
link: '/api/ts',
77+
items: [
78+
{ text: 'Kind', link: '/api/ts/kind' },
79+
{ text: 'Test', link: '/api/ts/test' },
80+
{ text: 'Union', link: '/api/ts/union' },
81+
{ text: 'Variance', link: '/api/ts/variance' },
82+
],
83+
},
84+
],
85+
},
86+
],
87+
},
9988

10089
socialLinks: [
10190
{ icon: 'github', link: 'https://github.com/jasonkuhrt/kit' },

docs/api/arr.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Arr
2+
3+
Array utilities for working with readonly and mutable arrays.
4+
5+
Provides functional utilities for array operations including mapping, filtering,
6+
type guards, and conversions. Emphasizes immutable operations and type safety.
7+
8+
## Import
9+
10+
```typescript
11+
import { Arr } from '@wollybeard/kit/arr'
12+
```
13+
14+
## Functions
15+
16+
### assert <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L113)</sub>
17+
18+
Assert that a value is an array.
19+
Throws a TypeError if the value is not an array.
20+
21+
```typescript
22+
export function assert(value: unknown): void
23+
```
24+
25+
**Examples:**
26+
27+
```ts twoslash
28+
Arr.assert(value)
29+
// value is now typed as unknown[]
30+
value.forEach(item => console.log(item))
31+
}
32+
```
33+
34+
### includes <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L136)</sub>
35+
36+
```typescript
37+
<$T>(array: $T[], value: unknown) => value is $T
38+
```
39+
40+
### ensure <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L156)</sub>
41+
42+
```typescript
43+
<$T>(value: $T | $T[]) => $T[]
44+
```
45+
46+
## Constants
47+
48+
### Eq <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/traits/eq.ts#L33)</sub>
49+
50+
```typescript
51+
Eq<Any>
52+
```
53+
54+
### Type <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/traits/type.ts#L20)</sub>
55+
56+
```typescript
57+
Type<Any>
58+
```
59+
60+
### empty <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L71)</sub>
61+
62+
```typescript
63+
readonly []
64+
```
65+
66+
### emptyArray <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L82)</sub>
67+
68+
```typescript
69+
readonly []
70+
```
71+
72+
## Types
73+
74+
### Unknown <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L9)</sub>
75+
76+
```typescript
77+
export type Unknown = readonly unknown[]
78+
```
79+
80+
### Any <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L11)</sub>
81+
82+
```typescript
83+
export type Any = readonly any[]
84+
```
85+
86+
### Empty <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L13)</sub>
87+
88+
```typescript
89+
export type Empty = readonly []
90+
```
91+
92+
### All <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L26)</sub>
93+
94+
Check if all booleans in a tuple are true.
95+
96+
```typescript
97+
export type All<$Tuple extends [...boolean[]]> = $Tuple[number] extends true
98+
? true
99+
: false
100+
```
101+
102+
**Examples:**
103+
104+
```ts twoslash
105+
type T2 = All<[true, false, true]> // false
106+
```
107+
108+
### IsTupleMultiple <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L37)</sub>
109+
110+
Check if a tuple has multiple elements.
111+
112+
```typescript
113+
export type IsTupleMultiple<$T> = $T extends [unknown, unknown, ...unknown[]]
114+
? true
115+
: false
116+
```
117+
118+
**Examples:**
119+
120+
```ts twoslash
121+
type T2 = IsTupleMultiple<[1]> // false
122+
```
123+
124+
### Push <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L47)</sub>
125+
126+
Push a value onto a tuple.
127+
128+
```typescript
129+
export type Push<$T extends any[], $V> = [...$T, $V]
130+
```
131+
132+
**Examples:**
133+
134+
```ts twoslash
135+
```
136+
137+
### FirstNonUnknownNever <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L52)</sub>
138+
139+
Get the first non-unknown, non-never element from a tuple.
140+
141+
```typescript
142+
export type FirstNonUnknownNever<$T extends any[]> = $T extends
143+
[infer __first__, ...infer __rest__]
144+
? unknown extends __first__
145+
? 0 extends 1 & __first__ ? FirstNonUnknownNever<__rest__> // is any
146+
: FirstNonUnknownNever<__rest__> // is unknown
147+
: __first__ extends never ? FirstNonUnknownNever<__rest__>
148+
: __first__
149+
: never
150+
```
151+
152+
### EmptyArray <sub style="float: right;">[📄](https://github.com/jasonkuhrt/kit/blob/main/src/domains/arr/arr.ts#L87)</sub>
153+
154+
Type for the empty array constant.
155+
156+
```typescript
157+
export type EmptyArray = typeof emptyArray
158+
```

0 commit comments

Comments
 (0)