@microsoft/teams-js 2.4.0-beta.0 → 2.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,10 @@
1
1
  // Generated by dts-bundle v0.7.3
2
+ // Dependencies for this module:
3
+ // ../@fluidframework/azure-client
4
+ // ../@fluidframework/fluid-static
5
+
6
+ import type { AzureConnectionConfig, AzureContainerServices, ITelemetryBaseLogger } from '@fluidframework/azure-client';
7
+ import type { ContainerSchema, IFluidContainer } from '@fluidframework/fluid-static';
2
8
 
3
9
  /**
4
10
  * @hidden
@@ -895,21 +901,22 @@ export namespace files {
895
901
  /**
896
902
  * @hidden
897
903
  * Object used to represent a file
904
+ * @beta
898
905
  *
899
906
  * @internal
900
907
  * Limited to Microsoft-internal use
901
908
  */
902
909
  export interface File extends Blob {
903
910
  /**
904
- * Last modified timestamp
911
+ * A number that represents the number of milliseconds since the Unix epoch
905
912
  */
906
- lastModified: Date;
913
+ lastModified: number;
907
914
  /**
908
915
  * Name of the file
909
916
  */
910
917
  name: string;
911
918
  /**
912
- * The file path to uniquely identify it within the file hierarchy
919
+ * A string containing the path of the file relative to the ancestor directory the user selected
913
920
  */
914
921
  webkitRelativePath?: string;
915
922
  }
@@ -3828,7 +3835,7 @@ export namespace app {
3828
3835
  */
3829
3836
  meeting?: MeetingInfo;
3830
3837
  /**
3831
- * SharePoint context. This is only available when hosted in SharePoint.
3838
+ * When hosted in SharePoint, this is the [SharePoint PageContext](https://learn.microsoft.com/en-us/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest), else `undefined`
3832
3839
  */
3833
3840
  sharepoint?: any;
3834
3841
  /**
@@ -6848,3 +6855,281 @@ export namespace tasks {
6848
6855
  function getDefaultSizeIfNotProvided(taskInfo: TaskInfo): TaskInfo;
6849
6856
  }
6850
6857
 
6858
+ /**
6859
+ * Namespace to interact with the Live Share module-specific part of the SDK.
6860
+ *
6861
+ * @beta
6862
+ */
6863
+ export namespace liveShare {
6864
+ /**
6865
+ * Options used to configure the Live Share client.
6866
+ *
6867
+ * @beta
6868
+ */
6869
+ interface LiveShareOptions {
6870
+ /**
6871
+ * Optional. Configuration to use when connecting to a custom Azure Fluid Relay instance.
6872
+ */
6873
+ readonly connection?: AzureConnectionConfig;
6874
+ /**
6875
+ * Optional. A logger instance to receive diagnostic messages.
6876
+ */
6877
+ readonly logger?: ITelemetryBaseLogger;
6878
+ /**
6879
+ * Optional. Function to lookup the ID of the container to use for local testing.
6880
+ *
6881
+ * @remarks
6882
+ * The default implementation attempts to retrieve the containerId from the `window.location.hash`.
6883
+ *
6884
+ * If the function returns 'undefined' a new container will be created.
6885
+ * @returns ID of the container to connect to or `undefined` if a new container should be created.
6886
+ */
6887
+ readonly getLocalTestContainerId?: () => string | undefined;
6888
+ /**
6889
+ * Optional. Function to save the ID of a newly created local test container.
6890
+ *
6891
+ * @remarks
6892
+ * The default implementation updates `window.location.hash` with the ID of the newly created
6893
+ * container.
6894
+ * @param containerId The ID of the container that was created.
6895
+ */
6896
+ readonly setLocalTestContainerId?: (containerId: string) => void;
6897
+ }
6898
+ /**
6899
+ * Initializes the Live Share client.
6900
+ * @param options Optional. Configuration options passed to the Live Share client.
6901
+ *
6902
+ * @beta
6903
+ */
6904
+ function initialize(options?: LiveShareOptions): Promise<void>;
6905
+ /**
6906
+ * Connects to the fluid container for the current teams context.
6907
+ *
6908
+ * @remarks
6909
+ * The first client joining the container will create the container resulting in the
6910
+ * `onContainerFirstCreated` callback being called. This callback can be used to set the initial
6911
+ * state of of the containers object prior to the container being attached.
6912
+ * @param fluidContainerSchema Fluid objects to create.
6913
+ * @param onContainerFirstCreated Optional. Callback that's called when the container is first created.
6914
+ * @returns The fluid `container` and `services` objects to use along with a `created` flag that if true means the container had to be created.
6915
+ *
6916
+ * @beta
6917
+ */
6918
+ function joinContainer(fluidContainerSchema: ContainerSchema, onContainerFirstCreated?: (container: IFluidContainer) => void): Promise<{
6919
+ container: IFluidContainer;
6920
+ services: AzureContainerServices;
6921
+ created: boolean;
6922
+ }>;
6923
+ /**
6924
+ * @hidden
6925
+ * Hide from docs
6926
+ * ------
6927
+ * Returns the LiveShareHost object. Called by existing apps that use the TeamsFluidClient
6928
+ * directly. This prevents existing apps from breaking and will be removed when Live Share
6929
+ * goes GA.
6930
+ *
6931
+ * @beta
6932
+ */
6933
+ function getHost(): LiveShareHost;
6934
+ }
6935
+
6936
+ /**
6937
+ * @hidden
6938
+ * @internal
6939
+ * Limited to Microsoft-internal use
6940
+ * ------
6941
+ * Allowed roles during a meeting.
6942
+ */
6943
+ export enum UserMeetingRole {
6944
+ guest = "Guest",
6945
+ attendee = "Attendee",
6946
+ presenter = "Presenter",
6947
+ organizer = "Organizer"
6948
+ }
6949
+ /**
6950
+ * @hidden
6951
+ * @internal
6952
+ * Limited to Microsoft-internal use
6953
+ * ------
6954
+ * State of the current Live Share sessions backing fluid container.
6955
+ */
6956
+ export enum ContainerState {
6957
+ /**
6958
+ * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
6959
+ * for the current Live Share session.
6960
+ */
6961
+ added = "Added",
6962
+ /**
6963
+ * A container mapping for the current Live Share Session already exists and should be used
6964
+ * when joining the sessions Fluid container.
6965
+ */
6966
+ alreadyExists = "AlreadyExists",
6967
+ /**
6968
+ * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
6969
+ * another client having already set the container ID for the current Live Share session.
6970
+ */
6971
+ conflict = "Conflict",
6972
+ /**
6973
+ * A container mapping for the current Live Share session doesn't exist yet.
6974
+ */
6975
+ notFound = "NotFound"
6976
+ }
6977
+ /**
6978
+ * @hidden
6979
+ * @internal
6980
+ * Limited to Microsoft-internal use
6981
+ * ------
6982
+ * Returned from `LiveShareHost.get/setFluidContainerId()` to specify the container mapping for the
6983
+ * current Live Share session.
6984
+ */
6985
+ export interface IFluidContainerInfo {
6986
+ /**
6987
+ * State of the containerId mapping.
6988
+ */
6989
+ containerState: ContainerState;
6990
+ /**
6991
+ * ID of the container to join for the meeting. Undefined if the container hasn't been
6992
+ * created yet.
6993
+ */
6994
+ containerId: string | undefined;
6995
+ /**
6996
+ * If true, the local client should create the container and then save the created containers
6997
+ * ID to the mapping service.
6998
+ */
6999
+ shouldCreate: boolean;
7000
+ /**
7001
+ * If `containerId` is undefined and `shouldCreate` is false, the container isn't ready but
7002
+ * another client is creating it. The local client should wait the specified amount of time and
7003
+ * then ask for the container info again.
7004
+ */
7005
+ retryAfter: number;
7006
+ }
7007
+ /**
7008
+ * @hidden
7009
+ * @internal
7010
+ * Limited to Microsoft-internal use
7011
+ * ------
7012
+ * Returned from `LiveShareHost.getNtpTime()` to specify the global timestamp for the current
7013
+ * Live Share session.
7014
+ */
7015
+ export interface INtpTimeInfo {
7016
+ /**
7017
+ * ISO 8601 formatted server time. For example: '2019-09-07T15:50-04:00'
7018
+ */
7019
+ ntpTime: string;
7020
+ /**
7021
+ * Server time expressed as the number of milliseconds since the ECMAScript epoch.
7022
+ */
7023
+ ntpTimeInUTC: number;
7024
+ }
7025
+ /**
7026
+ * @hidden
7027
+ * @internal
7028
+ * Limited to Microsoft-internal use
7029
+ * ------
7030
+ * Returned from `LiveShareHost.getFluidTenantInfo()` to specify the Fluid service to use for the
7031
+ * current Live Share session.
7032
+ */
7033
+ export interface IFluidTenantInfo {
7034
+ /**
7035
+ * The Fluid Tenant ID Live Share should use.
7036
+ */
7037
+ tenantId: string;
7038
+ /**
7039
+ * The Fluid service endpoint Live Share should use.
7040
+ */
7041
+ serviceEndpoint?: string;
7042
+ /**
7043
+ * @deprecated
7044
+ * As of Fluid 1.0 this configuration information has been deprecated in favor of
7045
+ * `serviceEndpoint`.
7046
+ */
7047
+ ordererEndpoint: string;
7048
+ /**
7049
+ * @deprecated
7050
+ * As of Fluid 1.0 this configuration information has been deprecated in favor of
7051
+ * `serviceEndpoint`.
7052
+ */
7053
+ storageEndpoint: string;
7054
+ }
7055
+ /**
7056
+ * @hidden
7057
+ * @internal
7058
+ * Limited to Microsoft-internal use
7059
+ * ------
7060
+ * Interface for hosting a Live Share session within a client like Teams.
7061
+ */
7062
+ export class LiveShareHost {
7063
+ /**
7064
+ * @hidden
7065
+ * @internal
7066
+ * Limited to Microsoft-internal use
7067
+ * ------
7068
+ * Returns the Fluid Tenant connection info for user's current context.
7069
+ */
7070
+ getFluidTenantInfo(): Promise<IFluidTenantInfo>;
7071
+ /**
7072
+ * @hidden
7073
+ * @internal
7074
+ * Limited to Microsoft-internal use
7075
+ * ------
7076
+ * Returns the fluid access token for mapped container Id.
7077
+ *
7078
+ * @param containerId Fluid's container Id for the request. Undefined for new containers.
7079
+ * @returns token for connecting to Fluid's session.
7080
+ */
7081
+ getFluidToken(containerId?: string): Promise<string>;
7082
+ /**
7083
+ * @hidden
7084
+ * @internal
7085
+ * Limited to Microsoft-internal use
7086
+ * ------
7087
+ * Returns the ID of the fluid container associated with the user's current context.
7088
+ */
7089
+ getFluidContainerId(): Promise<IFluidContainerInfo>;
7090
+ /**
7091
+ * @hidden
7092
+ * @internal
7093
+ * Limited to Microsoft-internal use
7094
+ * ------
7095
+ * Sets the ID of the fluid container associated with the current context.
7096
+ *
7097
+ * @remarks
7098
+ * If this returns false, the client should delete the container they created and then call
7099
+ * `getFluidContainerId()` to get the ID of the container being used.
7100
+ * @param containerId ID of the fluid container the client created.
7101
+ * @returns A data structure with a `containerState` indicating the success or failure of the request.
7102
+ */
7103
+ setFluidContainerId(containerId: string): Promise<IFluidContainerInfo>;
7104
+ /**
7105
+ * @hidden
7106
+ * @internal
7107
+ * Limited to Microsoft-internal use
7108
+ * ------
7109
+ * Returns the shared clock server's current time.
7110
+ */
7111
+ getNtpTime(): Promise<INtpTimeInfo>;
7112
+ /**
7113
+ * @hidden
7114
+ * @internal
7115
+ * Limited to Microsoft-internal use
7116
+ * ------
7117
+ * Associates the fluid client ID with a set of user roles.
7118
+ *
7119
+ * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
7120
+ * @returns The roles for the current user.
7121
+ */
7122
+ registerClientId(clientId: string): Promise<UserMeetingRole[]>;
7123
+ /**
7124
+ * @hidden
7125
+ * @internal
7126
+ * Limited to Microsoft-internal use
7127
+ * ------
7128
+ * Returns the roles associated with a client ID.
7129
+ *
7130
+ * @param clientId The Client ID the message was received from.
7131
+ * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
7132
+ */
7133
+ getClientRoles(clientId: string): Promise<UserMeetingRole[] | undefined>;
7134
+ }
7135
+