Skip to content

Commit

Permalink
doc(daemon): add doc for Handle and InternalHandle in types.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kumavis committed Feb 20, 2024
1 parent d643f0c commit 35ece3f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/daemon/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,19 @@ export type ProvideControllerForFormulaIdentifierAndResolveHandle = (
formulaIdentifier: string,
) => Promise<Controller>;

/**
* A handle is used to create a pointer to a formula without exposing
* it directly. For example, this is used to provide an EndoGuest with a
* reference to its creator EndoHost. By using a handle that points to the host
* instead of giving a direct reference to the host, the guest does not get
* access to the functions of the host. This is the external facet of a handle.
* It directly exposes nothing. The handle's target is only exposed on the internal facet.
*/
export interface Handle {}
/**
* This is the internal facet of a handle. It exposes the formula id that the
* handle points to. This should not be exposed outside of the endo daemon.
*/
export interface InternalHandle {
targetFormulaIdentifier: string;
}
Expand Down

0 comments on commit 35ece3f

Please sign in to comment.