Skip to content

Commit 696b10c

Browse files
committed
[skip ci] doc
1 parent 93fe326 commit 696b10c

28 files changed

+408
-387
lines changed

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**sync-op****Docs**
1+
**sync-op**
22

33
***
44

doc/classes/Channel.md

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
[**sync-op**](../README.md)**Docs**
1+
[**sync-op**](../README.md)
22

33
***
44

55
[sync-op](../README.md) / Channel
66

77
# Class: Channel\<T\>
88

9+
Defined in: [channel.ts:23](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L23)
10+
911
the synchronous channel
1012

1113
## Type Parameters
1214

13-
**T**
15+
### T
16+
17+
`T`
1418

1519
## Implements
1620

@@ -19,9 +23,11 @@ the synchronous channel
1923

2024
## Constructors
2125

22-
### new Channel()
26+
### Constructor
2327

24-
> **new Channel**\<`T`\>(`capacity`): [`Channel`](Channel.md)\<`T`\>
28+
> **new Channel**\<`T`\>(`capacity`): `Channel`\<`T`\>
29+
30+
Defined in: [channel.ts:38](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L38)
2531

2632
create a new channel with buffer size `capacity`
2733

@@ -32,22 +38,22 @@ const buffered = new Channel(1)
3238

3339
#### Parameters
3440

35-
**capacity**: `number` = `0`
41+
##### capacity
3642

37-
#### Returns
43+
`number` = `0`
3844

39-
[`Channel`](Channel.md)\<`T`\>
40-
41-
#### Defined in
45+
#### Returns
4246

43-
[channel.ts:38](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L38)
47+
`Channel`\<`T`\>
4448

4549
## Methods
4650

4751
### \[asyncIterator\]()
4852

4953
> **\[asyncIterator\]**(): `AsyncGenerator`\<`Awaited`\<`T`\>, `void`, `unknown`\>
5054
55+
Defined in: [channel.ts:182](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L182)
56+
5157
```typescript
5258
const ch = new Channel()
5359
ch.send(1)
@@ -63,18 +69,16 @@ for await (const msg of ch) {
6369

6470
#### Implementation of
6571

66-
[`readableChannel`](../interfaces/readableChannel.md).[`[asyncIterator]`](../interfaces/readableChannel.md#%5Basynciterator%5D)
67-
68-
#### Defined in
69-
70-
[channel.ts:182](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L182)
72+
[`readableChannel`](../interfaces/readableChannel.md).[`[asyncIterator]`](../interfaces/readableChannel.md#asynciterator)
7173

7274
***
7375

7476
### close()
7577

7678
> **close**(): `void`
7779
80+
Defined in: [channel.ts:52](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L52)
81+
7882
#### Returns
7983

8084
`void`
@@ -83,16 +87,14 @@ for await (const msg of ch) {
8387

8488
[`writableChannel`](../interfaces/writableChannel.md).[`close`](../interfaces/writableChannel.md#close)
8589

86-
#### Defined in
87-
88-
[channel.ts:52](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L52)
89-
9090
***
9191

9292
### isClosed()
9393

9494
> **isClosed**(): `boolean`
9595
96+
Defined in: [channel.ts:64](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L64)
97+
9698
#### Returns
9799

98100
`boolean`
@@ -101,16 +103,14 @@ for await (const msg of ch) {
101103

102104
[`writableChannel`](../interfaces/writableChannel.md).[`isClosed`](../interfaces/writableChannel.md#isclosed)
103105

104-
#### Defined in
105-
106-
[channel.ts:64](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L64)
107-
108106
***
109107

110108
### isDrained()
111109

112110
> **isDrained**(): `boolean`
113111
112+
Defined in: [channel.ts:71](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L71)
113+
114114
returns `true` if the buffer is empty and there are no pending senders.
115115

116116
#### Returns
@@ -121,16 +121,14 @@ returns `true` if the buffer is empty and there are no pending senders.
121121

122122
[`writableChannel`](../interfaces/writableChannel.md).[`isDrained`](../interfaces/writableChannel.md#isdrained)
123123

124-
#### Defined in
125-
126-
[channel.ts:71](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L71)
127-
128124
***
129125

130126
### receive()
131127

132128
> **receive**(): [`Op`](Op.md)\<[`Option`](../type-aliases/Option.md)\<`T`\>\>
133129
130+
Defined in: [channel.ts:132](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L132)
131+
134132
receives a message from the channel.
135133
if the channel is drained, return `none`.
136134

@@ -147,16 +145,14 @@ const msg = await op.sync()
147145

148146
[`readableChannel`](../interfaces/readableChannel.md).[`receive`](../interfaces/readableChannel.md#receive)
149147

150-
#### Defined in
151-
152-
[channel.ts:132](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L132)
153-
154148
***
155149

156150
### send()
157151

158152
> **send**(`data`): [`Op`](Op.md)\<`boolean`\>
159153
154+
Defined in: [channel.ts:88](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/channel.ts#L88)
155+
160156
sends the `data` message to the channel.
161157
if channel is closed, return `false`.
162158

@@ -167,7 +163,9 @@ await op.sync()
167163

168164
#### Parameters
169165

170-
**data**: `T`
166+
##### data
167+
168+
`T`
171169

172170
#### Returns
173171

@@ -176,7 +174,3 @@ await op.sync()
176174
#### Implementation of
177175

178176
[`writableChannel`](../interfaces/writableChannel.md).[`send`](../interfaces/writableChannel.md#send)
179-
180-
#### Defined in
181-
182-
[channel.ts:88](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/channel.ts#L88)

doc/classes/Deferred.md

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,95 @@
1-
[**sync-op**](../README.md)**Docs**
1+
[**sync-op**](../README.md)
22

33
***
44

55
[sync-op](../README.md) / Deferred
66

77
# Class: Deferred\<T\>
88

9+
Defined in: [deferred.ts:1](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L1)
10+
911
## Type Parameters
1012

11-
**T** = `void`
13+
### T
14+
15+
`T` = `void`
1216

1317
## Constructors
1418

15-
### new Deferred()
19+
### Constructor
1620

17-
> **new Deferred**\<`T`\>(): [`Deferred`](Deferred.md)\<`T`\>
21+
> **new Deferred**\<`T`\>(): `Deferred`\<`T`\>
1822
19-
#### Returns
23+
Defined in: [deferred.ts:9](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L9)
2024

21-
[`Deferred`](Deferred.md)\<`T`\>
22-
23-
#### Defined in
25+
#### Returns
2426

25-
[deferred.ts:9](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L9)
27+
`Deferred`\<`T`\>
2628

2729
## Properties
2830

2931
### isFulfilled
3032

3133
> **isFulfilled**: `boolean`
3234
33-
#### Defined in
34-
35-
[deferred.ts:3](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L3)
35+
Defined in: [deferred.ts:3](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L3)
3636

3737
***
3838

3939
### isRejected
4040

4141
> **isRejected**: `boolean`
4242
43-
#### Defined in
44-
45-
[deferred.ts:5](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L5)
43+
Defined in: [deferred.ts:5](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L5)
4644

4745
***
4846

4947
### isResolved
5048

5149
> **isResolved**: `boolean`
5250
53-
#### Defined in
54-
55-
[deferred.ts:4](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L4)
51+
Defined in: [deferred.ts:4](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L4)
5652

5753
***
5854

5955
### promise
6056

6157
> **promise**: `Promise`\<`T`\>
6258
63-
#### Defined in
64-
65-
[deferred.ts:2](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L2)
59+
Defined in: [deferred.ts:2](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L2)
6660

6761
***
6862

6963
### reject()
7064

71-
> **reject**: (`err`?) => `void`
65+
> **reject**: (`err?`) => `void`
66+
67+
Defined in: [deferred.ts:7](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L7)
7268

7369
#### Parameters
7470

75-
**err?**: `unknown`
71+
##### err?
72+
73+
`unknown`
7674

7775
#### Returns
7876

7977
`void`
8078

81-
#### Defined in
82-
83-
[deferred.ts:7](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L7)
84-
8579
***
8680

8781
### resolve()
8882

8983
> **resolve**: (`payload`) => `void`
9084
85+
Defined in: [deferred.ts:6](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/deferred.ts#L6)
86+
9187
#### Parameters
9288

93-
**payload**: `T` \| `PromiseLike`\<`T`\>
89+
##### payload
90+
91+
`T` | `PromiseLike`\<`T`\>
9492

9593
#### Returns
9694

9795
`void`
98-
99-
#### Defined in
100-
101-
[deferred.ts:6](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/deferred.ts#L6)

doc/classes/IVar.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
[**sync-op**](../README.md)**Docs**
1+
[**sync-op**](../README.md)
22

33
***
44

55
[sync-op](../README.md) / IVar
66

77
# Class: IVar\<T\>
88

9+
Defined in: [extension.ts:210](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/extension.ts#L210)
10+
911
## Type Parameters
1012

11-
**T**
13+
### T
1214

13-
## Constructors
15+
`T`
1416

15-
### new IVar()
17+
## Constructors
1618

17-
> **new IVar**\<`T`\>(): [`IVar`](IVar.md)\<`T`\>
19+
### Constructor
1820

19-
#### Returns
21+
> **new IVar**\<`T`\>(): `IVar`\<`T`\>
2022
21-
[`IVar`](IVar.md)\<`T`\>
23+
Defined in: [extension.ts:213](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/extension.ts#L213)
2224

23-
#### Defined in
25+
#### Returns
2426

25-
[extension.ts:213](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/extension.ts#L213)
27+
`IVar`\<`T`\>
2628

2729
## Methods
2830

2931
### get()
3032

3133
> **get**(): [`Op`](Op.md)\<`T`\>
3234
35+
Defined in: [extension.ts:236](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/extension.ts#L236)
36+
3337
read `IVar`
3438

3539
#### Returns
3640

3741
[`Op`](Op.md)\<`T`\>
3842

39-
#### Defined in
40-
41-
[extension.ts:236](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/extension.ts#L236)
42-
4343
***
4444

4545
### put()
4646

4747
> **put**(`value`): `boolean`
4848
49+
Defined in: [extension.ts:222](https://github.com/dhcmrlchtdj/sync-op/blob/93fe32636f3c6c188a811dfea276951b3e31f9bc/src/extension.ts#L222)
50+
4951
fill `IVar` if it is empty.
5052
return `false` if it's not empty.
5153

5254
#### Parameters
5355

54-
**value**: `T`
56+
##### value
57+
58+
`T`
5559

5660
#### Returns
5761

5862
`boolean`
59-
60-
#### Defined in
61-
62-
[extension.ts:222](https://github.com/dhcmrlchtdj/sync-op/blob/163328e6c4e45f4e1851de6e0cd2086a60714f03/src/extension.ts#L222)

0 commit comments

Comments
 (0)