@jupyterlab/testutils 4.0.0-alpha.16 → 4.0.0-alpha.18

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.
package/lib/user.d.ts DELETED
@@ -1,60 +0,0 @@
1
- import { ReadonlyJSONObject } from '@lumino/coreutils';
2
- import { ISignal } from '@lumino/signaling';
3
- import { BaseManager, ServerConnection, User, UserManager } from '@jupyterlab/services';
4
- /**
5
- * The user API service manager.
6
- */
7
- export declare class FakeUserManager extends BaseManager implements User.IManager {
8
- private _isReady;
9
- private _ready;
10
- private _identity;
11
- private _permissions;
12
- private _userChanged;
13
- private _connectionFailure;
14
- /**
15
- * Create a new user manager.
16
- */
17
- constructor(options: UserManager.IOptions | undefined, identity: User.IIdentity, permissions: ReadonlyJSONObject);
18
- /**
19
- * The server settings for the manager.
20
- */
21
- readonly serverSettings: ServerConnection.ISettings;
22
- /**
23
- * Test whether the manager is ready.
24
- */
25
- get isReady(): boolean;
26
- /**
27
- * A promise that fulfills when the manager is ready.
28
- */
29
- get ready(): Promise<void>;
30
- /**
31
- * Get the most recently fetched identity.
32
- */
33
- get identity(): User.IIdentity | null;
34
- /**
35
- * Get the most recently fetched permissions.
36
- */
37
- get permissions(): ReadonlyJSONObject | null;
38
- /**
39
- * A signal emitted when the user changes.
40
- */
41
- get userChanged(): ISignal<this, User.IUser>;
42
- /**
43
- * A signal emitted when there is a connection failure.
44
- */
45
- get connectionFailure(): ISignal<this, Error>;
46
- /**
47
- * Dispose of the resources used by the manager.
48
- */
49
- dispose(): void;
50
- /**
51
- * Force a refresh of the specs from the server.
52
- *
53
- * @returns A promise that resolves when the specs are fetched.
54
- *
55
- * #### Notes
56
- * This is intended to be called only in response to a user action,
57
- * since the manager maintains its internal state.
58
- */
59
- refreshUser(): Promise<void>;
60
- }
package/lib/user.js DELETED
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FakeUserManager = void 0;
4
- const signaling_1 = require("@lumino/signaling");
5
- const services_1 = require("@jupyterlab/services");
6
- /**
7
- * The user API service manager.
8
- */
9
- class FakeUserManager extends services_1.BaseManager {
10
- /**
11
- * Create a new user manager.
12
- */
13
- constructor(options = {}, identity, permissions) {
14
- super(options);
15
- this._isReady = false;
16
- this._userChanged = new signaling_1.Signal(this);
17
- this._connectionFailure = new signaling_1.Signal(this);
18
- // Initialize internal data.
19
- this._ready = new Promise(resolve => {
20
- // Schedule updating the user to the next macro task queue.
21
- setTimeout(() => {
22
- this._identity = identity;
23
- this._permissions = permissions;
24
- this._userChanged.emit({
25
- identity: this._identity,
26
- permissions: this._permissions
27
- });
28
- resolve();
29
- }, 0);
30
- })
31
- .then(() => {
32
- if (this.isDisposed) {
33
- return;
34
- }
35
- this._isReady = true;
36
- })
37
- .catch(_ => undefined);
38
- }
39
- /**
40
- * Test whether the manager is ready.
41
- */
42
- get isReady() {
43
- return this._isReady;
44
- }
45
- /**
46
- * A promise that fulfills when the manager is ready.
47
- */
48
- get ready() {
49
- return this._ready;
50
- }
51
- /**
52
- * Get the most recently fetched identity.
53
- */
54
- get identity() {
55
- return this._identity;
56
- }
57
- /**
58
- * Get the most recently fetched permissions.
59
- */
60
- get permissions() {
61
- return this._permissions;
62
- }
63
- /**
64
- * A signal emitted when the user changes.
65
- */
66
- get userChanged() {
67
- return this._userChanged;
68
- }
69
- /**
70
- * A signal emitted when there is a connection failure.
71
- */
72
- get connectionFailure() {
73
- return this._connectionFailure;
74
- }
75
- /**
76
- * Dispose of the resources used by the manager.
77
- */
78
- dispose() {
79
- super.dispose();
80
- }
81
- /**
82
- * Force a refresh of the specs from the server.
83
- *
84
- * @returns A promise that resolves when the specs are fetched.
85
- *
86
- * #### Notes
87
- * This is intended to be called only in response to a user action,
88
- * since the manager maintains its internal state.
89
- */
90
- async refreshUser() {
91
- return Promise.resolve();
92
- }
93
- }
94
- exports.FakeUserManager = FakeUserManager;
95
- //# sourceMappingURL=user.js.map
package/lib/user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