@fluidframework/fluid-static
Advanced tools
Comparing version 0.46.0 to 0.47.0-35912
@@ -9,3 +9,3 @@ /*! | ||
import { IEvent, IEventProvider } from "@fluidframework/common-definitions"; | ||
import { IAudience } from "@fluidframework/container-definitions"; | ||
import { IAudience, AttachState } from "@fluidframework/container-definitions"; | ||
import { LoadableObjectClass, LoadableObjectRecord } from "./types"; | ||
@@ -19,3 +19,2 @@ import { RootDataObject } from "./rootDataObject"; | ||
readonly disposed: boolean; | ||
readonly id: string; | ||
readonly initialObjects: LoadableObjectRecord; | ||
@@ -26,9 +25,10 @@ create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>; | ||
export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer { | ||
readonly id: string; | ||
private readonly container; | ||
private readonly rootDataObject; | ||
private readonly attachCallback; | ||
private readonly connectedHandler; | ||
private readonly disconnectedHandler; | ||
private readonly disposedHandler; | ||
constructor(id: string, container: Container, rootDataObject: RootDataObject); | ||
constructor(container: Container, rootDataObject: RootDataObject, attachCallback: () => Promise<string>); | ||
get attachState(): AttachState; | ||
get disposed(): boolean; | ||
@@ -45,2 +45,3 @@ get connected(): boolean; | ||
get clientId(): string | undefined; | ||
attach(): Promise<string>; | ||
create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>; | ||
@@ -47,0 +48,0 @@ dispose(): void; |
@@ -9,8 +9,9 @@ "use strict"; | ||
const common_utils_1 = require("@fluidframework/common-utils"); | ||
const container_definitions_1 = require("@fluidframework/container-definitions"); | ||
class FluidContainer extends common_utils_1.TypedEventEmitter { | ||
constructor(id, container, rootDataObject) { | ||
constructor(container, rootDataObject, attachCallback) { | ||
super(); | ||
this.id = id; | ||
this.container = container; | ||
this.rootDataObject = rootDataObject; | ||
this.attachCallback = attachCallback; | ||
this.connectedHandler = () => this.emit("connected"); | ||
@@ -23,2 +24,5 @@ this.disconnectedHandler = () => this.emit("disconnected"); | ||
} | ||
get attachState() { | ||
return this.container.attachState; | ||
} | ||
get disposed() { | ||
@@ -45,2 +49,10 @@ return this.container.closed; | ||
} | ||
async attach() { | ||
if (this.attachState === container_definitions_1.AttachState.Detached) { | ||
return this.attachCallback(); | ||
} | ||
else { | ||
throw new Error("Cannot attach container. Container is not in detached state"); | ||
} | ||
} | ||
async create(objectClass) { | ||
@@ -47,0 +59,0 @@ return this.rootDataObject.create(objectClass); |
@@ -17,3 +17,3 @@ /*! | ||
* A DataObjectClass is a class that has a factory that can create a DataObject and a | ||
* contructor that will return the type of the DataObject. | ||
* constructor that will return the type of the DataObject. | ||
*/ | ||
@@ -25,3 +25,3 @@ export declare type DataObjectClass<T extends IFluidLoadable> = { | ||
* A SharedObjectClass is a class that has a factory that can create a DDS (SharedObject) and a | ||
* contructor that will return the type of the DataObject. | ||
* constructor that will return the type of the DataObject. | ||
*/ | ||
@@ -37,9 +37,2 @@ export declare type SharedObjectClass<T extends IFluidLoadable> = { | ||
/** | ||
* Name of the container being defined. | ||
* | ||
* This property is not currently used by Fluid but instead provides the developer a centralized | ||
* location to name their container. It is useful in multi-container scenarios. | ||
*/ | ||
name: string; | ||
/** | ||
* initialObjects defines loadable objects that will be created when the Container | ||
@@ -46,0 +39,0 @@ * is first created. It uses the key as the id and the value as the loadable object to create. |
@@ -9,3 +9,3 @@ /*! | ||
import { IEvent, IEventProvider } from "@fluidframework/common-definitions"; | ||
import { IAudience } from "@fluidframework/container-definitions"; | ||
import { IAudience, AttachState } from "@fluidframework/container-definitions"; | ||
import { LoadableObjectClass, LoadableObjectRecord } from "./types"; | ||
@@ -19,3 +19,2 @@ import { RootDataObject } from "./rootDataObject"; | ||
readonly disposed: boolean; | ||
readonly id: string; | ||
readonly initialObjects: LoadableObjectRecord; | ||
@@ -26,9 +25,10 @@ create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>; | ||
export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer { | ||
readonly id: string; | ||
private readonly container; | ||
private readonly rootDataObject; | ||
private readonly attachCallback; | ||
private readonly connectedHandler; | ||
private readonly disconnectedHandler; | ||
private readonly disposedHandler; | ||
constructor(id: string, container: Container, rootDataObject: RootDataObject); | ||
constructor(container: Container, rootDataObject: RootDataObject, attachCallback: () => Promise<string>); | ||
get attachState(): AttachState; | ||
get disposed(): boolean; | ||
@@ -45,2 +45,3 @@ get connected(): boolean; | ||
get clientId(): string | undefined; | ||
attach(): Promise<string>; | ||
create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>; | ||
@@ -47,0 +48,0 @@ dispose(): void; |
@@ -6,8 +6,9 @@ /*! | ||
import { TypedEventEmitter } from "@fluidframework/common-utils"; | ||
import { AttachState } from "@fluidframework/container-definitions"; | ||
export class FluidContainer extends TypedEventEmitter { | ||
constructor(id, container, rootDataObject) { | ||
constructor(container, rootDataObject, attachCallback) { | ||
super(); | ||
this.id = id; | ||
this.container = container; | ||
this.rootDataObject = rootDataObject; | ||
this.attachCallback = attachCallback; | ||
this.connectedHandler = () => this.emit("connected"); | ||
@@ -20,2 +21,5 @@ this.disconnectedHandler = () => this.emit("disconnected"); | ||
} | ||
get attachState() { | ||
return this.container.attachState; | ||
} | ||
get disposed() { | ||
@@ -42,2 +46,10 @@ return this.container.closed; | ||
} | ||
async attach() { | ||
if (this.attachState === AttachState.Detached) { | ||
return this.attachCallback(); | ||
} | ||
else { | ||
throw new Error("Cannot attach container. Container is not in detached state"); | ||
} | ||
} | ||
async create(objectClass) { | ||
@@ -44,0 +56,0 @@ return this.rootDataObject.create(objectClass); |
@@ -17,3 +17,3 @@ /*! | ||
* A DataObjectClass is a class that has a factory that can create a DataObject and a | ||
* contructor that will return the type of the DataObject. | ||
* constructor that will return the type of the DataObject. | ||
*/ | ||
@@ -25,3 +25,3 @@ export declare type DataObjectClass<T extends IFluidLoadable> = { | ||
* A SharedObjectClass is a class that has a factory that can create a DDS (SharedObject) and a | ||
* contructor that will return the type of the DataObject. | ||
* constructor that will return the type of the DataObject. | ||
*/ | ||
@@ -37,9 +37,2 @@ export declare type SharedObjectClass<T extends IFluidLoadable> = { | ||
/** | ||
* Name of the container being defined. | ||
* | ||
* This property is not currently used by Fluid but instead provides the developer a centralized | ||
* location to name their container. It is useful in multi-container scenarios. | ||
*/ | ||
name: string; | ||
/** | ||
* initialObjects defines loadable objects that will be created when the Container | ||
@@ -46,0 +39,0 @@ * is first created. It uses the key as the id and the value as the loadable object to create. |
{ | ||
"name": "@fluidframework/fluid-static", | ||
"version": "0.46.0", | ||
"version": "0.47.0-35912", | ||
"description": "A tool to enable consumption of Fluid Data Objects without requiring custom container code.", | ||
@@ -32,17 +32,17 @@ "homepage": "https://fluidframework.com", | ||
"dependencies": { | ||
"@fluidframework/aqueduct": "^0.46.0", | ||
"@fluidframework/aqueduct": "0.47.0-35912", | ||
"@fluidframework/common-definitions": "^0.20.1", | ||
"@fluidframework/common-utils": "^0.32.1", | ||
"@fluidframework/container-definitions": "^0.39.8", | ||
"@fluidframework/container-loader": "^0.46.0", | ||
"@fluidframework/container-runtime-definitions": "^0.46.0", | ||
"@fluidframework/container-loader": "0.47.0-35912", | ||
"@fluidframework/container-runtime-definitions": "0.47.0-35912", | ||
"@fluidframework/core-interfaces": "^0.39.7", | ||
"@fluidframework/datastore-definitions": "^0.46.0", | ||
"@fluidframework/datastore-definitions": "0.47.0-35912", | ||
"@fluidframework/protocol-definitions": "^0.1024.0", | ||
"@fluidframework/request-handler": "^0.46.0", | ||
"@fluidframework/runtime-definitions": "^0.46.0", | ||
"@fluidframework/runtime-utils": "^0.46.0" | ||
"@fluidframework/request-handler": "0.47.0-35912", | ||
"@fluidframework/runtime-definitions": "0.47.0-35912", | ||
"@fluidframework/runtime-utils": "0.47.0-35912" | ||
}, | ||
"devDependencies": { | ||
"@fluid-experimental/get-container": "^0.46.0", | ||
"@fluid-experimental/get-container": "0.47.0-35912", | ||
"@fluidframework/build-common": "^0.22.0", | ||
@@ -49,0 +49,0 @@ "@fluidframework/eslint-config-fluid": "^0.23.0", |
@@ -9,3 +9,3 @@ /*! | ||
import { IEvent, IEventProvider } from "@fluidframework/common-definitions"; | ||
import { IAudience } from "@fluidframework/container-definitions"; | ||
import { IAudience, AttachState } from "@fluidframework/container-definitions"; | ||
import { LoadableObjectClass, LoadableObjectRecord } from "./types"; | ||
@@ -21,3 +21,2 @@ import { RootDataObject } from "./rootDataObject"; | ||
readonly disposed: boolean; | ||
readonly id: string; | ||
readonly initialObjects: LoadableObjectRecord; | ||
@@ -34,5 +33,5 @@ create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>; | ||
public constructor( | ||
public readonly id: string, | ||
private readonly container: Container, | ||
private readonly rootDataObject: RootDataObject, | ||
private readonly attachCallback: () => Promise<string>, | ||
) { | ||
@@ -45,2 +44,6 @@ super(); | ||
public get attachState(): AttachState { | ||
return this.container.attachState; | ||
} | ||
public get disposed() { | ||
@@ -72,2 +75,10 @@ return this.container.closed; | ||
public async attach() { | ||
if (this.attachState === AttachState.Detached) { | ||
return this.attachCallback(); | ||
} else { | ||
throw new Error("Cannot attach container. Container is not in detached state"); | ||
} | ||
} | ||
public async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> { | ||
@@ -74,0 +85,0 @@ return this.rootDataObject.create(objectClass); |
@@ -22,3 +22,3 @@ /*! | ||
* A DataObjectClass is a class that has a factory that can create a DataObject and a | ||
* contructor that will return the type of the DataObject. | ||
* constructor that will return the type of the DataObject. | ||
*/ | ||
@@ -30,3 +30,3 @@ export type DataObjectClass<T extends IFluidLoadable> | ||
* A SharedObjectClass is a class that has a factory that can create a DDS (SharedObject) and a | ||
* contructor that will return the type of the DataObject. | ||
* constructor that will return the type of the DataObject. | ||
*/ | ||
@@ -43,10 +43,2 @@ export type SharedObjectClass<T extends IFluidLoadable> | ||
/** | ||
* Name of the container being defined. | ||
* | ||
* This property is not currently used by Fluid but instead provides the developer a centralized | ||
* location to name their container. It is useful in multi-container scenarios. | ||
*/ | ||
name: string; | ||
/** | ||
* initialObjects defines loadable objects that will be created when the Container | ||
@@ -53,0 +45,0 @@ * is first created. It uses the key as the id and the value as the loadable object to create. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225019
2443
+ Added@fluidframework/aqueduct@0.47.0-35912(transitive)
+ Added@fluidframework/container-loader@0.47.0-35912(transitive)
+ Added@fluidframework/container-runtime@0.47.0-35912(transitive)
+ Added@fluidframework/container-runtime-definitions@0.47.0-35912(transitive)
+ Added@fluidframework/container-utils@0.47.0-35912(transitive)
+ Added@fluidframework/datastore@0.47.0-35912(transitive)
+ Added@fluidframework/datastore-definitions@0.47.0-35912(transitive)
+ Added@fluidframework/driver-utils@0.47.0-35912(transitive)
+ Added@fluidframework/garbage-collector@0.47.0-35912(transitive)
+ Added@fluidframework/gitresources@0.1030.0(transitive)
+ Added@fluidframework/map@0.47.0-35912(transitive)
+ Added@fluidframework/protocol-base@0.1030.0(transitive)
+ Added@fluidframework/request-handler@0.47.0-35912(transitive)
+ Added@fluidframework/runtime-definitions@0.47.0-35912(transitive)
+ Added@fluidframework/runtime-utils@0.47.0-35912(transitive)
+ Added@fluidframework/shared-object-base@0.47.0-35912(transitive)
+ Added@fluidframework/synthesize@0.47.0-35912(transitive)
+ Added@fluidframework/telemetry-utils@0.47.0-35912(transitive)
+ Added@fluidframework/view-interfaces@0.47.0-35912(transitive)
- Removed@fluidframework/aqueduct@0.46.2(transitive)
- Removed@fluidframework/container-loader@0.46.2(transitive)
- Removed@fluidframework/container-runtime@0.46.2(transitive)
- Removed@fluidframework/container-runtime-definitions@0.46.2(transitive)
- Removed@fluidframework/container-utils@0.46.2(transitive)
- Removed@fluidframework/datastore@0.46.2(transitive)
- Removed@fluidframework/datastore-definitions@0.46.2(transitive)
- Removed@fluidframework/driver-utils@0.46.2(transitive)
- Removed@fluidframework/garbage-collector@0.46.2(transitive)
- Removed@fluidframework/gitresources@0.1029.0(transitive)
- Removed@fluidframework/map@0.46.2(transitive)
- Removed@fluidframework/protocol-base@0.1029.0(transitive)
- Removed@fluidframework/request-handler@0.46.2(transitive)
- Removed@fluidframework/runtime-definitions@0.46.2(transitive)
- Removed@fluidframework/runtime-utils@0.46.2(transitive)
- Removed@fluidframework/shared-object-base@0.46.2(transitive)
- Removed@fluidframework/synthesize@0.46.2(transitive)
- Removed@fluidframework/telemetry-utils@0.46.2(transitive)
- Removed@fluidframework/view-interfaces@0.46.2(transitive)
Updated@fluidframework/container-runtime-definitions@0.47.0-35912