Skip to content

Commit 936175a

Browse files
hbcarlosfcollonvalpre-commit-ci[bot]
authored
Adds the API for a ISharedDocument factory (#125)
* Adds the API for a ISharedDocument factory * Update javascript/src/api.ts Co-authored-by: Frédéric Collonval <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixes tests Co-authored-by: Frédéric Collonval <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7ad87f3 commit 936175a

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
- name: Install Miniconda
4444
uses: conda-incubator/setup-miniconda@v2
4545
with:
46-
mamba-version: "*"
47-
channels: conda-forge
46+
miniforge-variant: Mambaforge
47+
miniforge-version: latest
4848
python-version: "3.7"
4949

5050
- name: Install dependencies

javascript/src/api.ts

+39
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,45 @@ export type MapChanges = Map<
4141
}
4242
>;
4343

44+
/**
45+
* A factory interface for creating `ISharedDocument` objects.
46+
*/
47+
export interface IFactory {
48+
/**
49+
* Create a new `ISharedDocument` instance.
50+
*/
51+
createNew(options: IFactory.IOptions): ISharedDocument;
52+
}
53+
54+
/**
55+
* The namespace for `IFactory`.
56+
*/
57+
export namespace IFactory {
58+
/**
59+
* The options used to instantiate a ISharedDocument
60+
*/
61+
export interface IOptions {
62+
/**
63+
* The path of the file.
64+
*/
65+
path: string;
66+
/**
67+
* The format of the document.
68+
*/
69+
format: string;
70+
/**
71+
* The content type of the document.
72+
*/
73+
contentType: string;
74+
/**
75+
* Wether the document is collaborative or not.
76+
*
77+
* The default value is `true`.
78+
*/
79+
collaborative?: boolean;
80+
}
81+
}
82+
4483
/**
4584
* ISharedBase defines common operations that can be performed on any shared object.
4685
*/

0 commit comments

Comments
 (0)