-
Notifications
You must be signed in to change notification settings - Fork 549
feat(client): [internal] container extensions and presence
use
#24399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c207f58
8b219d7
1872d87
62d3fa6
b1f8232
112853b
11c4a19
f2e7304
beb23e2
ce07bf4
a7e847b
2f3b12e
b0d8db2
1c4be86
98b0e92
f1c3bea
d92548a
a6ad229
46fa5bf
5b1ed99
41cfcc6
ce572d1
1d0fddd
75001bd
7ec1564
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@fluidframework/presence": minor | ||
"__section": feature | ||
--- | ||
"getPresence(container: IFluidContainer): Presence" now supported | ||
|
||
`getPresence` is now supported and may be used to directly acquire `Presence` instead of using `ExperimentalPresenceManager` in container schema and calling `getPresenceViaDataObject`. (Both of those are now deprecated.) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
/** | ||
* Base branded type which can be used to annotate other type. | ||
* | ||
* @remarks | ||
* To use derive another class declaration and ideally add additional private | ||
* properties to further distinguish the type. | ||
* | ||
* Since branded types are not real value types, they will always need to be | ||
* created using `as` syntax and very often `as unknown` first. | ||
* | ||
* This class should never exist at runtime, so it is only declared. | ||
* | ||
* @sealed | ||
* @internal | ||
*/ | ||
export declare class BrandedType<out Brand> { | ||
/** | ||
* Compile time only marker to make type checking more strict. | ||
* This method will not exist at runtime and accessing it is invalid. | ||
* | ||
* @privateRemarks | ||
* `Brand` is used as the return type of a method rather than a simple | ||
* readonly property as this allows types with two brands to be | ||
* intersected without getting `never`. | ||
* The method takes in `never` to help emphasize that it's not callable. | ||
*/ | ||
protected readonly brand: (dummy: never) => Brand; | ||
|
||
protected constructor(); | ||
|
||
/** | ||
* Since this class is a compile time only type brand, `instanceof` will | ||
* never work with it. * This `Symbol.hasInstance` implementation ensures | ||
* that `instanceof` will error if used, and in TypeScript 5.3 and newer | ||
* will produce a compile time error if used. | ||
*/ | ||
public static [Symbol.hasInstance](value: never): value is never; | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,6 +3,28 @@ | |||||
* Licensed under the MIT License. | ||||||
*/ | ||||||
|
||||||
/** | ||||||
* A message that has a string `type` associated with `content`. | ||||||
* | ||||||
* @remarks | ||||||
* This type is meant to be used indirectly. Most commonly as a constraint | ||||||
* for generics of message structures. | ||||||
* | ||||||
* @legacy | ||||||
* @alpha | ||||||
*/ | ||||||
export interface TypedMessage { | ||||||
/** | ||||||
* The type of the message. | ||||||
*/ | ||||||
type: string; | ||||||
|
||||||
/** | ||||||
* The contents of the message. | ||||||
*/ | ||||||
content: unknown; | ||||||
} | ||||||
|
||||||
/** | ||||||
* @internal | ||||||
* | ||||||
|
@@ -13,7 +35,7 @@ | |||||
* | ||||||
* See at `server/routerlicious/packages/lambdas/src/utils/messageGenerator.ts`. | ||||||
*/ | ||||||
export interface ISignalEnvelope { | ||||||
export interface ISignalEnvelope<TMessage extends TypedMessage = TypedMessage> { | ||||||
/** | ||||||
* The target for the envelope, undefined for the container | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess that's not right, I see it used in ContainerRuntime. I was misinterpreting the doc comment for the interface, which seems to indicate that address will always be missing. |
||||||
*/ | ||||||
|
@@ -27,9 +49,5 @@ export interface ISignalEnvelope { | |||||
/** | ||||||
* The contents of the envelope | ||||||
*/ | ||||||
contents: { | ||||||
type: string; | ||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
content: any; | ||||||
}; | ||||||
contents: TMessage; | ||||||
} |
Uh oh!
There was an error while loading. Please reload this page.