Skip to content

Commit d9162af

Browse files
committed
0.0.20
1 parent 6c51a30 commit d9162af

File tree

12 files changed

+56
-38
lines changed

12 files changed

+56
-38
lines changed

docs/functions/editable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
> **editable**\<`T`\>(`element`, `__namedParameters`): [`EditableHandle`](../interfaces/EditableHandle.md)
88
9-
Defined in: [editable.ts:112](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L112)
9+
Defined in: [editable.ts:112](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L112)
1010

1111
A function to make DOM editable.
1212

docs/functions/plainSchema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
> **plainSchema**(`__namedParameters`): [`EditableSchema`](../interfaces/EditableSchema.md)\<`string`\>
88
9-
Defined in: [schema/plain.ts:18](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/plain.ts#L18)
9+
Defined in: [schema/plain.ts:18](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/plain.ts#L18)
1010

1111
Defines plain text schema.
1212

docs/functions/schema.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
# Function: schema()
66

7-
> **schema**\<`V`, `M`\>(`__namedParameters`): [`EditableSchema`](../interfaces/EditableSchema.md)\<`M` *extends* `true` ? (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: (...) extends (...) ? (...) : (...) \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[][] : (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: (...)\[(...)\] extends EditableVoidSerializer\<(...)\> ? D : never \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[]\>
7+
> **schema**\<`V`, `M`\>(`__namedParameters`): [`EditableSchema`](../interfaces/EditableSchema.md)\<`M` *extends* `true` ? (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: ExtractVoidData\<(...)\> \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[][] : (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: ExtractVoidData\<(...)\[(...)\]\> \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[]\>
88
9-
Defined in: [schema/structured.ts:45](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/structured.ts#L45)
9+
Defined in: [schema/structured.ts:46](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/structured.ts#L46)
1010

1111
Defines structured text schema.
1212

@@ -30,4 +30,4 @@ Defines structured text schema.
3030

3131
## Returns
3232

33-
[`EditableSchema`](../interfaces/EditableSchema.md)\<`M` *extends* `true` ? (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: (...) extends (...) ? (...) : (...) \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[][] : (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: (...)\[(...)\] extends EditableVoidSerializer\<(...)\> ? D : never \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[]\>
33+
[`EditableSchema`](../interfaces/EditableSchema.md)\<`M` *extends* `true` ? (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: ExtractVoidData\<(...)\> \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[][] : (\{ \[K in string \| number \| symbol\]: \{ \[K in string \| number \| symbol\]: \{ type: K; data: ExtractVoidData\<(...)\[(...)\]\> \} \}\[keyof V\]\[K\] \} \| \{ `type`: `"text"`; `text`: `string`; \})[]\>

docs/functions/voidNode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
> **voidNode**\<`D`\>(`__namedParameters`): [`EditableVoidSerializer`](../interfaces/EditableVoidSerializer.md)\<`D`\>
88
9-
Defined in: [schema/structured.ts:13](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/structured.ts#L13)
9+
Defined in: [schema/structured.ts:13](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/structured.ts#L13)
1010

1111
## Type Parameters
1212

@@ -26,7 +26,7 @@ Defined in: [schema/structured.ts:13](https://github.com/inokawa/edix/blob/5dda0
2626

2727
#### plain?
2828

29-
(`node`) => `string` = `toString`
29+
(`data`) => `string` = `emptyString`
3030

3131
## Returns
3232

docs/interfaces/EditableHandle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Interface: EditableHandle
66

7-
Defined in: [editable.ts:97](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L97)
7+
Defined in: [editable.ts:97](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L97)
88

99
Methods of editor instance.
1010

@@ -14,7 +14,7 @@ Methods of editor instance.
1414

1515
> **dispose**: () => `void`
1616
17-
Defined in: [editable.ts:101](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L101)
17+
Defined in: [editable.ts:101](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L101)
1818

1919
Disposes editor and restores previous DOM state.
2020

@@ -28,7 +28,7 @@ Disposes editor and restores previous DOM state.
2828

2929
> **readonly**: (`value`) => `void`
3030
31-
Defined in: [editable.ts:106](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L106)
31+
Defined in: [editable.ts:106](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L106)
3232

3333
Changes editor's read-only state.
3434

docs/interfaces/EditableOptions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Interface: EditableOptions\<T\>
66

7-
Defined in: [editable.ts:79](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L79)
7+
Defined in: [editable.ts:79](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L79)
88

99
Options of [editable](../functions/editable.md).
1010

@@ -18,7 +18,7 @@ Options of [editable](../functions/editable.md).
1818

1919
> **schema**: [`EditableSchema`](EditableSchema.md)\<`T`\>
2020
21-
Defined in: [editable.ts:83](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L83)
21+
Defined in: [editable.ts:83](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L83)
2222

2323
TODO
2424

@@ -28,7 +28,7 @@ TODO
2828

2929
> `optional` **isBlock**: (`node`) => `boolean`
3030
31-
Defined in: [editable.ts:87](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L87)
31+
Defined in: [editable.ts:87](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L87)
3232

3333
TODO
3434

@@ -48,7 +48,7 @@ TODO
4848

4949
> **onChange**: (`value`) => `void`
5050
51-
Defined in: [editable.ts:91](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/editable.ts#L91)
51+
Defined in: [editable.ts:91](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/editable.ts#L91)
5252

5353
TODO
5454

docs/interfaces/EditableSchema.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Interface: EditableSchema\<T\>
66

7-
Defined in: [schema/types.ts:3](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L3)
7+
Defined in: [schema/types.ts:3](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L3)
88

99
## Type Parameters
1010

@@ -16,43 +16,61 @@ Defined in: [schema/types.ts:3](https://github.com/inokawa/edix/blob/5dda010c7d4
1616

1717
> **single**: `boolean`
1818
19-
Defined in: [schema/types.ts:4](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L4)
19+
Defined in: [schema/types.ts:4](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L4)
2020

2121
***
2222

23-
### data()
23+
### js()
2424

25-
> **data**: (`snapshot`) => `T`
25+
> **js**: (`doc`) => `T`
2626
27-
Defined in: [schema/types.ts:5](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L5)
27+
Defined in: [schema/types.ts:5](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L5)
2828

2929
#### Parameters
3030

31-
##### snapshot
31+
##### doc
3232

33-
`DomSnapshot`
33+
`DocFragment`
3434

3535
#### Returns
3636

3737
`T`
3838

3939
***
4040

41+
### void()
42+
43+
> **void**: (`element`) => `void` \| `Record`\<`string`, `unknown`\>
44+
45+
Defined in: [schema/types.ts:6](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L6)
46+
47+
#### Parameters
48+
49+
##### element
50+
51+
`Element`
52+
53+
#### Returns
54+
55+
`void` \| `Record`\<`string`, `unknown`\>
56+
57+
***
58+
4159
### copy()
4260

43-
> **copy**: (`dataTransfer`, `snapshot`, `dom`) => `void`
61+
> **copy**: (`dataTransfer`, `doc`, `dom`) => `void`
4462
45-
Defined in: [schema/types.ts:6](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L6)
63+
Defined in: [schema/types.ts:7](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L7)
4664

4765
#### Parameters
4866

4967
##### dataTransfer
5068

5169
`DataTransfer`
5270

53-
##### snapshot
71+
##### doc
5472

55-
`DomSnapshot`
73+
`DocFragment`
5674

5775
##### dom
5876

@@ -68,7 +86,7 @@ Defined in: [schema/types.ts:6](https://github.com/inokawa/edix/blob/5dda010c7d4
6886

6987
> **paste**: (`dataTransfer`) => `string` \| `Node`
7088
71-
Defined in: [schema/types.ts:7](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L7)
89+
Defined in: [schema/types.ts:8](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L8)
7290

7391
#### Parameters
7492

docs/interfaces/EditableVoidSerializer.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Interface: EditableVoidSerializer\<T\>
66

7-
Defined in: [schema/structured.ts:5](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/structured.ts#L5)
7+
Defined in: [schema/structured.ts:5](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/structured.ts#L5)
88

99
## Type Parameters
1010

@@ -16,7 +16,7 @@ Defined in: [schema/structured.ts:5](https://github.com/inokawa/edix/blob/5dda01
1616

1717
> **is**: (`node`) => `boolean`
1818
19-
Defined in: [schema/structured.ts:6](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/structured.ts#L6)
19+
Defined in: [schema/structured.ts:6](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/structured.ts#L6)
2020

2121
#### Parameters
2222

@@ -34,7 +34,7 @@ Defined in: [schema/structured.ts:6](https://github.com/inokawa/edix/blob/5dda01
3434

3535
> **data**: (`node`) => `T`
3636
37-
Defined in: [schema/structured.ts:7](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/structured.ts#L7)
37+
Defined in: [schema/structured.ts:7](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/structured.ts#L7)
3838

3939
#### Parameters
4040

@@ -50,15 +50,15 @@ Defined in: [schema/structured.ts:7](https://github.com/inokawa/edix/blob/5dda01
5050

5151
### plain()
5252

53-
> **plain**: (`node`) => `string`
53+
> **plain**: (`data`) => `string`
5454
55-
Defined in: [schema/structured.ts:8](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/structured.ts#L8)
55+
Defined in: [schema/structured.ts:8](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/structured.ts#L8)
5656

5757
#### Parameters
5858

59-
##### node
59+
##### data
6060

61-
`HTMLElement`
61+
`T`
6262

6363
#### Returns
6464

docs/type-aliases/InferDoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
> **InferDoc**\<`T`\>: `T` *extends* [`EditableSchema`](../interfaces/EditableSchema.md)\<infer N\> ? `N` : `never`
88
9-
Defined in: [schema/types.ts:12](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L12)
9+
Defined in: [schema/types.ts:13](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L13)
1010

1111
## Type Parameters
1212

docs/type-aliases/InferNode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
> **InferNode**\<`T`\>: `T` *extends* [`EditableSchema`](../interfaces/EditableSchema.md)\<infer N\> ? `ExtractItem`\<`N`\> : `never`
88
9-
Defined in: [schema/types.ts:13](https://github.com/inokawa/edix/blob/5dda010c7d491e5c9162d0f17dc6178b28acc47b/src/core/schema/types.ts#L13)
9+
Defined in: [schema/types.ts:14](https://github.com/inokawa/edix/blob/6c51a3045dd266d2df11ac3bf40a8c324611c95f/src/core/schema/types.ts#L14)
1010

1111
## Type Parameters
1212

0 commit comments

Comments
 (0)