@opra/core 1.26.0 → 1.26.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/core",
3
- "version": "1.26.0",
3
+ "version": "1.26.2",
4
4
  "description": "Opra schema package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "tslib": "^2.8.1"
11
11
  },
12
12
  "peerDependencies": {
13
- "@opra/common": "^1.26.0"
13
+ "@opra/common": "^1.26.2"
14
14
  },
15
15
  "type": "module",
16
16
  "module": "./index.js",
package/service-base.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  import type { Nullish } from 'ts-gems';
2
2
  import type { ExecutionContext } from './execution-context.js';
3
3
  export declare abstract class ServiceBase {
4
- protected _context: ExecutionContext;
4
+ protected _context?: ExecutionContext;
5
+ constructor(options?: ServiceBase.Options);
5
6
  get context(): ExecutionContext;
6
7
  for<C extends ExecutionContext, P extends Partial<this>>(context: C | ServiceBase, overwriteProperties?: Nullish<P>, overwriteContext?: Partial<C>): this & Required<P>;
7
8
  protected _assertContext(): void;
8
9
  }
9
10
  export declare namespace ServiceBase {
10
11
  const extendSymbol: unique symbol;
12
+ interface Options {
13
+ context?: ExecutionContext;
14
+ }
11
15
  }
package/service-base.js CHANGED
@@ -1,4 +1,7 @@
1
1
  export class ServiceBase {
2
+ constructor(options) {
3
+ this._context = options?.context;
4
+ }
2
5
  get context() {
3
6
  this._assertContext();
4
7
  return this._context;