Skip to content

Commit

Permalink
Merge pull request #268 from holochain/support-system-signals
Browse files Browse the repository at this point in the history
Support system signals
  • Loading branch information
ThetaSinner committed Aug 22, 2024
2 parents aeaf0a6 + 384479c commit 08b9177
Show file tree
Hide file tree
Showing 22 changed files with 328 additions and 86 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added
### Changed
- Signal listeners changed from only returning an `AppSignal` to a `Signal` which can be either an app or system signal.
### Fixed
### Removed

Expand Down
4 changes: 2 additions & 2 deletions docs/client.appclient.on.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
**Signature:**

```typescript
on<Name extends keyof AppEvents>(eventName: Name | readonly Name[], listener: AppSignalCb): UnsubscribeFunction;
on<Name extends keyof AppEvents>(eventName: Name | readonly Name[], listener: SignalCb): UnsubscribeFunction;
```
## Parameters
Expand Down Expand Up @@ -49,7 +49,7 @@ listener
</td><td>
[AppSignalCb](./client.appsignalcb.md)
[SignalCb](./client.signalcb.md)
</td><td>
Expand Down
2 changes: 1 addition & 1 deletion docs/client.appevents.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Description

</td><td>

[AppSignal](./client.appsignal.md)
[Signal](./client.signal.md)


</td><td>
Expand Down
2 changes: 1 addition & 1 deletion docs/client.appevents.signal.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
**Signature:**

```typescript
signal: AppSignal;
signal: Signal;
```
14 changes: 0 additions & 14 deletions docs/client.appsignalcb.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/client.appwebsocket.on.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Register an event listener for signals.
**Signature:**

```typescript
on<Name extends keyof AppEvents>(eventName: Name | readonly Name[], listener: AppSignalCb): UnsubscribeFunction;
on<Name extends keyof AppEvents>(eventName: Name | readonly Name[], listener: SignalCb): UnsubscribeFunction;
```
## Parameters
Expand Down Expand Up @@ -53,7 +53,7 @@ listener
</td><td>
[AppSignalCb](./client.appsignalcb.md)
[SignalCb](./client.signalcb.md)
</td><td>
Expand Down
50 changes: 40 additions & 10 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,16 @@ Description



</td></tr>
<tr><td>

[PreflightResponse](./client.preflightresponse.md)


</td><td>



</td></tr>
<tr><td>

Expand Down Expand Up @@ -1454,16 +1464,6 @@ This type is meant to be opaque



</td></tr>
<tr><td>

[AppSignalCb](./client.appsignalcb.md)


</td><td>



</td></tr>
<tr><td>

Expand Down Expand Up @@ -2465,6 +2465,16 @@ An internal link type index within the DNA, from 0 to 255.



</td></tr>
<tr><td>

[RawSignal](./client.rawsignal.md)


</td><td>



</td></tr>
<tr><td>

Expand Down Expand Up @@ -2585,6 +2595,16 @@ An internal link type index within the DNA, from 0 to 255.



</td></tr>
<tr><td>

[SignalCb](./client.signalcb.md)


</td><td>



</td></tr>
<tr><td>

Expand Down Expand Up @@ -2635,6 +2655,16 @@ An internal link type index within the DNA, from 0 to 255.



</td></tr>
<tr><td>

[SystemSignal](./client.systemsignal.md)


</td><td>



</td></tr>
<tr><td>

Expand Down
13 changes: 13 additions & 0 deletions docs/client.preflightresponse.agent_state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [PreflightResponse](./client.preflightresponse.md) &gt; [agent\_state](./client.preflightresponse.agent_state.md)

## PreflightResponse.agent\_state property

The chain state declaration for the agent that produced this response.

**Signature:**

```typescript
agent_state: CountersigningAgentState;
```
94 changes: 94 additions & 0 deletions docs/client.preflightresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [PreflightResponse](./client.preflightresponse.md)

## PreflightResponse interface


**Signature:**

```typescript
export interface PreflightResponse
```

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[agent\_state](./client.preflightresponse.agent_state.md)


</td><td>


</td><td>

[CountersigningAgentState](./client.countersigningagentstate.md)


</td><td>

The chain state declaration for the agent that produced this response.


</td></tr>
<tr><td>

[request](./client.preflightresponse.request.md)


</td><td>


</td><td>

[PreflightRequest](./client.preflightrequest.md)


</td><td>

The request associated with this response.


</td></tr>
<tr><td>

[signature](./client.preflightresponse.signature.md)


</td><td>


</td><td>

[Signature](./client.signature.md)


</td><td>

The signature of this response, by the agent that created it.


</td></tr>
</tbody></table>
13 changes: 13 additions & 0 deletions docs/client.preflightresponse.request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [PreflightResponse](./client.preflightresponse.md) &gt; [request](./client.preflightresponse.request.md)

## PreflightResponse.request property

The request associated with this response.

**Signature:**

```typescript
request: PreflightRequest;
```
13 changes: 13 additions & 0 deletions docs/client.preflightresponse.signature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [PreflightResponse](./client.preflightresponse.md) &gt; [signature](./client.preflightresponse.signature.md)

## PreflightResponse.signature property

The signature of this response, by the agent that created it.

**Signature:**

```typescript
signature: Signature;
```
18 changes: 18 additions & 0 deletions docs/client.rawsignal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [RawSignal](./client.rawsignal.md)

## RawSignal type


**Signature:**

```typescript
export type RawSignal = {
[SignalType.App]: EncodedAppSignal;
} | {
[SignalType.System]: SystemSignal;
};
```
**References:** [EncodedAppSignal](./client.encodedappsignal.md)<!-- -->, [SystemSignal](./client.systemsignal.md)

6 changes: 3 additions & 3 deletions docs/client.signal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

```typescript
export type Signal = {
[SignalType.App]: EncodedAppSignal;
[SignalType.App]: AppSignal;
} | {
[SignalType.System]: unknown;
[SignalType.System]: SystemSignal;
};
```
**References:** [EncodedAppSignal](./client.encodedappsignal.md)
**References:** [AppSignal](./client.appsignal.md)<!-- -->, [SystemSignal](./client.systemsignal.md)

14 changes: 14 additions & 0 deletions docs/client.signalcb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [SignalCb](./client.signalcb.md)

## SignalCb type


**Signature:**

```typescript
export type SignalCb = (signal: Signal) => void;
```
**References:** [Signal](./client.signal.md)

16 changes: 16 additions & 0 deletions docs/client.systemsignal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [SystemSignal](./client.systemsignal.md)

## SystemSignal type


**Signature:**

```typescript
export type SystemSignal = {
SuccessfulCountersigning: EntryHash;
};
```
**References:** [EntryHash](./client.entryhash.md)

Loading

0 comments on commit 08b9177

Please sign in to comment.