@thingmate/abilities 0.0.0-stage → 0.1.0

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.
Files changed (49) hide show
  1. package/CONTRIBUTING.md +131 -0
  2. package/LICENSE +21 -0
  3. package/README.md +25 -2
  4. package/package.json +23 -3
  5. package/src/combined/command/command-abilities.d.ts +11 -0
  6. package/src/combined/command/command-abilities.js +23 -0
  7. package/src/combined/command/command-abilities.js.map +1 -0
  8. package/src/combined/command/having-command-abilities.d.ts +4 -0
  9. package/src/combined/command/having-command-abilities.js +2 -0
  10. package/src/combined/command/having-command-abilities.js.map +1 -0
  11. package/src/combined/property/having-property-abilities.d.ts +4 -0
  12. package/src/combined/property/having-property-abilities.js +2 -0
  13. package/src/combined/property/having-property-abilities.js.map +1 -0
  14. package/src/combined/property/property-abilities.d.ts +15 -0
  15. package/src/combined/property/property-abilities.js +35 -0
  16. package/src/combined/property/property-abilities.js.map +1 -0
  17. package/src/combined/property/readonly/having-readonly-property-abilities.d.ts +4 -0
  18. package/src/combined/property/readonly/having-readonly-property-abilities.js +2 -0
  19. package/src/combined/property/readonly/having-readonly-property-abilities.js.map +1 -0
  20. package/src/combined/property/readonly/readonly-property-abilities.d.ts +11 -0
  21. package/src/combined/property/readonly/readonly-property-abilities.js +22 -0
  22. package/src/combined/property/readonly/readonly-property-abilities.js.map +1 -0
  23. package/src/index.d.ts +14 -0
  24. package/src/index.js +15 -0
  25. package/src/index.js.map +1 -0
  26. package/src/individual/observe/having-observe-ability.d.ts +4 -0
  27. package/src/individual/observe/having-observe-ability.js +2 -0
  28. package/src/individual/observe/having-observe-ability.js.map +1 -0
  29. package/src/individual/observe/observe-ability.d.ts +7 -0
  30. package/src/individual/observe/observe-ability.js +10 -0
  31. package/src/individual/observe/observe-ability.js.map +1 -0
  32. package/src/individual/read/having-read-ability.d.ts +4 -0
  33. package/src/individual/read/having-read-ability.js +2 -0
  34. package/src/individual/read/having-read-ability.js.map +1 -0
  35. package/src/individual/read/read-action.d.ts +2 -0
  36. package/src/individual/read/read-action.js +2 -0
  37. package/src/individual/read/read-action.js.map +1 -0
  38. package/src/individual/send/having-send-ability.d.ts +4 -0
  39. package/src/individual/send/having-send-ability.js +2 -0
  40. package/src/individual/send/having-send-ability.js.map +1 -0
  41. package/src/individual/send/send-action.d.ts +2 -0
  42. package/src/individual/send/send-action.js +2 -0
  43. package/src/individual/send/send-action.js.map +1 -0
  44. package/src/individual/write/having-write-ability.d.ts +4 -0
  45. package/src/individual/write/having-write-ability.js +2 -0
  46. package/src/individual/write/having-write-ability.js.map +1 -0
  47. package/src/individual/write/write-action.d.ts +2 -0
  48. package/src/individual/write/write-action.js +2 -0
  49. package/src/individual/write/write-action.js.map +1 -0
@@ -0,0 +1,131 @@
1
+ # Contributing
2
+
3
+ This projet is open to everyone. Feel free to test the library, share it, improve it, and create merge requests.
4
+
5
+ ## Getting started
6
+
7
+ ### Tools
8
+
9
+ #### [nvm](https://github.com/nvm-sh/nvm)
10
+
11
+ We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your Node.js versions.
12
+
13
+ ```shell
14
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
15
+ ```
16
+
17
+ #### [Node](https://nodejs.org)
18
+
19
+ ```shell
20
+ nvm use
21
+
22
+ # Verify the Node.js version:
23
+ node -v
24
+ ```
25
+
26
+ #### [Yarn](https://yarnpkg.com)
27
+
28
+ ```shell
29
+ corepack enable yarn
30
+
31
+ # Verify Yarn version:
32
+ yarn -v
33
+
34
+ # Install the dependencies:
35
+ yarn install
36
+ ```
37
+
38
+ ### Code
39
+
40
+ - The source code is located in the `src` directory.
41
+ - The projet uses [prettier](https://prettier.io/) to format the code. You'll want to enable and configure it in your IDE.
42
+ - The tests run with [vitest](https://vitest.dev)
43
+
44
+ ### Commands
45
+
46
+ - `fb:build`: builds the library.
47
+ - converts the typescript files into javascript files, copies the scss files, and assembles all the assets to create a package ready to be published.
48
+ - some files are handled differently:
49
+ - `*.protected.{ts,scss}` or `**/*.protected/**`: these files are exported under `package-name/protected`
50
+ - this is indented to expose parts of the code that should be restricted to advanced users only, or shared to other libraries requiring _internal_ control.
51
+ - `*.private.{ts,scss}` or `/*.private/**`: these files are **not** exported.
52
+ - this is indented to consume parts of the code internally, and not expose them publicly.
53
+ - `fb:format`: formats the code using `prettier`.
54
+ - `fb:test`: runs the tests using `vitest`.
55
+ - `fb:test:coverage`: runs the tests with coverage.
56
+ - by default, 100% code coverage is required, to enforce good quality.
57
+ - `fb:bench`: runs the bench tests.
58
+ - `fb:typedoc`: generates the documentation.
59
+ - if the library exposes publicly only a few and/or simple parts, the documentation may be defined in the `README.md` instead.
60
+
61
+ ### To create a PR
62
+
63
+ 1. fork the repository
64
+ 1. add the feature/fix by modifying the code in the `src/` directory
65
+ 1. add/write some tests until 100% code coverage is reached (run the tests with `yarn fb:test:coverage`)
66
+ 1. format the code, using the command `yarn fb:format`
67
+ 1. commit and push your work following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) convention
68
+ 1. create a PR from your repository to the upstream repository, explaining clearly what was added/fixed.
69
+
70
+ ## Release Workflow
71
+
72
+ > The `release.yml` workflow runs on `pull_request` and `push` events on the `main` and `develop` branches.
73
+ > It invokes the `yarn fb:ci:release` used to build and publish the package.
74
+ > Note that the `publish` step runs only if the equivalent stable version (`x.y.z`) does not already exist on npm
75
+
76
+ ### 1. Pull Request to `main` or `develop`
77
+
78
+ - The `dev` label is added to the PR
79
+ - Impacted packages are published as: `x.y.z-dev.<timestamp>`
80
+ - npm dist-tag: `dev`
81
+
82
+ > Use the `dev` versions only if required.
83
+
84
+ > NOTE: the PR is published only if it carries the `dev` label: add it to the PR to get a `dev` release, otherwise the release is skipped.
85
+ > Pull requests coming from forks always run in dry-run mode: nothing is published.
86
+
87
+ ### 2. Push to `develop`
88
+
89
+ - Impacted packages are published as: `x.y.z-rc.<timestamp>`
90
+ - npm dist-tag: `rc`
91
+
92
+ ### 3. Push to `main`
93
+
94
+ - Stable publication: `x.y.z`
95
+ - npm dist-tag: `latest`
96
+
97
+ ### Graph
98
+
99
+ ```mermaid
100
+ flowchart LR
101
+ EVENT("WORKFLOW TRIGGER")
102
+ HAS_DEV_TAG{"has &quotdev&quot tag ?"}
103
+ SKIP_BUILD(["skip build"])
104
+ BUILD_DEV_PACKAGES["build &quotdev&quot package"]
105
+ PUBLISH_DEV_PACKAGES["publish &quotdev&quot package"]
106
+ BUILD_RC_PACKAGES["build &quotrc&quot package"]
107
+ PUBLISH_RC_PACKAGES["publish &quotrc&quot package"]
108
+ BUILD_PROD_PACKAGES["build &quotprod&quot package"]
109
+ PUBLISH_PROD_PACKAGES["publish &quotprod&quot package"]
110
+ TARGET_BRANCH{"branch"}
111
+
112
+ EVENT -- "pull_request" --> HAS_DEV_TAG
113
+ HAS_DEV_TAG -- "no" --> SKIP_BUILD
114
+ HAS_DEV_TAG -- "yes" --> BUILD_DEV_PACKAGES
115
+ BUILD_DEV_PACKAGES --> PUBLISH_DEV_PACKAGES
116
+
117
+ EVENT -- "push" --> TARGET_BRANCH
118
+
119
+ TARGET_BRANCH -- "develop" --> BUILD_RC_PACKAGES
120
+ BUILD_RC_PACKAGES --> PUBLISH_RC_PACKAGES
121
+
122
+ TARGET_BRANCH -- "main" --> BUILD_PROD_PACKAGES
123
+ BUILD_PROD_PACKAGES --> PUBLISH_PROD_PACKAGES
124
+ ```
125
+
126
+ ## Important Rules
127
+
128
+ - if an equivalent **stable** version already exists on npm: the release fails — bump the `package.json#version` before releasing (this also blocks `dev` / `rc` releases of a stable version that was already published)
129
+ - the `package.json` file in the repo must keep stable versions (`x.y.z`)
130
+ - `-dev` / `-rc` suffixes are generated in CI
131
+ - the npm publish authenticates with [GitHub Actions OIDC](https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-oidc): no `NPM_TOKEN` secret is required (the `release.yml` workflow requests the `id-token: write` permission)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2026 Valentin Richard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,26 @@
1
- # Temporary Holding Version
1
+ [![npm (scoped)](https://img.shields.io/npm/v/@thingmate/abilities.svg)](https://www.npmjs.com/package/@thingmate/abilities)
2
+ ![npm](https://img.shields.io/npm/dm/@thingmate/abilities.svg)
3
+ ![NPM](https://img.shields.io/npm/l/@thingmate/abilities.svg)
4
+ ![npm type definitions](https://img.shields.io/npm/types/@thingmate/abilities.svg)
2
5
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
6
+ <picture>
7
+ <source height="64" media="(prefers-color-scheme: dark)" srcset="https://github.com/thingmate/website/blob/main/assets/logo/png/logo-large-dark.png?raw=true">
8
+ <source height="64" media="(prefers-color-scheme: light)" srcset="https://github.com/thingmate/website/blob/main/assets/logo/png/logo-large-light.png?raw=true">
9
+ <img height="64" alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://github.com/thingmate/website/blob/main/assets/logo/png/logo-large-light.png?raw=true">
10
+ </picture>
11
+
12
+ ## @thingmate/abilities
13
+
14
+ Generic abilities interfaces.
15
+
16
+ ## 📦 Installation
17
+
18
+ ```shell
19
+ yarn add @thingmate/abilities
20
+ # or
21
+ npm install @thingmate/abilities --save
22
+ ```
23
+
24
+ ## 📜 Documentation
25
+
26
+ TODO
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@thingmate/abilities",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Generic abilities interfaces",
6
+ "keywords": [],
7
+ "author": "Valentin Richard",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/thingmate/abilities.git"
12
+ },
13
+ "main": "./src/index.js",
14
+ "types": "./src/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./src/index.d.ts",
18
+ "default": "./src/index.js"
19
+ }
20
+ },
21
+ "dependencies": {
22
+ "@xstd/async-function": "^1.3.0",
23
+ "@xstd/map-function": "^1.3.0",
24
+ "@xstd/observable-async-function": "^0.1.0"
25
+ }
6
26
  }
@@ -0,0 +1,11 @@
1
+ import type { MapInOut } from '@xstd/map-function';
2
+ import type { ObservableAsyncFunction } from '@xstd/observable-async-function';
3
+ import type { SendAction } from '../../individual/send/send-action.ts';
4
+ import type { HavingCommandAbilities } from './having-command-abilities.ts';
5
+ export declare class CommandAbilities<GArguments extends readonly unknown[]> implements HavingCommandAbilities<GArguments> {
6
+ #private;
7
+ constructor({ send, observe }: HavingCommandAbilities<GArguments>);
8
+ get send(): SendAction<GArguments>;
9
+ get observe(): ObservableAsyncFunction<GArguments>;
10
+ map<GNewArguments extends readonly unknown[]>({ inOut, outIn, }: MapInOut<GArguments, GNewArguments>): CommandAbilities<GNewArguments>;
11
+ }
@@ -0,0 +1,23 @@
1
+ export class CommandAbilities {
2
+ #send;
3
+ #observe;
4
+ constructor({ send, observe }) {
5
+ this.#send = send;
6
+ this.#observe = observe;
7
+ }
8
+ get send() {
9
+ return this.#send;
10
+ }
11
+ get observe() {
12
+ return this.#observe;
13
+ }
14
+ map({ inOut, outIn, }) {
15
+ return new CommandAbilities({
16
+ send: this.#send.mapArguments((...args) => {
17
+ return outIn(args);
18
+ }),
19
+ observe: this.#observe.map(inOut),
20
+ });
21
+ }
22
+ }
23
+ //# sourceMappingURL=command-abilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-abilities.js","sourceRoot":"","sources":["../../../../src/combined/command/command-abilities.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,gBAAgB;IAGlB,KAAK,CAAyB;IAC9B,QAAQ,CAAsC;IAEvD,YAAY,EAAE,IAAI,EAAE,OAAO,EAAsC;QAC/D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,GAAG,CAA2C,EAC5C,KAAK,EACL,KAAK,GAC+B;QACpC,OAAO,IAAI,gBAAgB,CAAgB;YACzC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,IAAmB,EAAc,EAAE;gBACnE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC,CAAC;YACF,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { HavingObserveAbility } from '../../individual/observe/having-observe-ability.ts';
2
+ import type { HavingSendAbility } from '../../individual/send/having-send-ability.ts';
3
+ export interface HavingCommandAbilities<GArguments extends readonly unknown[]> extends HavingSendAbility<GArguments>, HavingObserveAbility<GArguments> {
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-command-abilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-command-abilities.js","sourceRoot":"","sources":["../../../../src/combined/command/having-command-abilities.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { HavingWriteAbility } from '../../individual/write/having-write-ability.ts';
2
+ import type { HavingReadonlyPropertyAbilities } from './readonly/having-readonly-property-abilities.ts';
3
+ export interface HavingPropertyAbilities<GValue> extends HavingReadonlyPropertyAbilities<GValue>, HavingWriteAbility<GValue> {
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-property-abilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-property-abilities.js","sourceRoot":"","sources":["../../../../src/combined/property/having-property-abilities.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { type MapInOut } from '@xstd/map-function';
2
+ import type { ObservableAsyncFunction } from '@xstd/observable-async-function';
3
+ import type { ReadAction } from '../../individual/read/read-action.ts';
4
+ import type { WriteAction } from '../../individual/write/write-action.ts';
5
+ import type { HavingPropertyAbilities } from './having-property-abilities.ts';
6
+ import { ReadonlyPropertyAbilities } from './readonly/readonly-property-abilities.ts';
7
+ export declare class PropertyAbilities<GValue> implements HavingPropertyAbilities<GValue> {
8
+ #private;
9
+ constructor({ read, write, observe }: HavingPropertyAbilities<GValue>);
10
+ get read(): ReadAction<GValue>;
11
+ get write(): WriteAction<GValue>;
12
+ get observe(): ObservableAsyncFunction<GValue>;
13
+ map<GNewValue>({ inOut, outIn }: MapInOut<GValue, GNewValue>): PropertyAbilities<GNewValue>;
14
+ asReadonly(): ReadonlyPropertyAbilities<GValue>;
15
+ }
@@ -0,0 +1,35 @@
1
+ import { mapOneArgument } from '@xstd/map-function';
2
+ import { ReadonlyPropertyAbilities } from './readonly/readonly-property-abilities.js';
3
+ export class PropertyAbilities {
4
+ #read;
5
+ #write;
6
+ #observe;
7
+ constructor({ read, write, observe }) {
8
+ this.#read = read;
9
+ this.#write = write;
10
+ this.#observe = observe;
11
+ }
12
+ get read() {
13
+ return this.#read;
14
+ }
15
+ get write() {
16
+ return this.#write;
17
+ }
18
+ get observe() {
19
+ return this.#observe;
20
+ }
21
+ map({ inOut, outIn }) {
22
+ return new PropertyAbilities({
23
+ read: this.#read.then(inOut),
24
+ write: this.#write.mapArguments(mapOneArgument(outIn)),
25
+ observe: this.#observe.map(inOut),
26
+ });
27
+ }
28
+ asReadonly() {
29
+ return new ReadonlyPropertyAbilities({
30
+ read: this.#read,
31
+ observe: this.#observe,
32
+ });
33
+ }
34
+ }
35
+ //# sourceMappingURL=property-abilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-abilities.js","sourceRoot":"","sources":["../../../../src/combined/property/property-abilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,OAAO,iBAAiB;IACnB,KAAK,CAAqB;IAC1B,MAAM,CAAsB;IAC5B,QAAQ,CAAkC;IAEnD,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAmC;QACnE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,GAAG,CAAY,EAAE,KAAK,EAAE,KAAK,EAA+B;QAC1D,OAAO,IAAI,iBAAiB,CAAY;YACtC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACtD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,OAAO,IAAI,yBAAyB,CAAS;YAC3C,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { HavingObserveAbility } from '../../../individual/observe/having-observe-ability.ts';
2
+ import type { HavingReadAbility } from '../../../individual/read/having-read-ability.ts';
3
+ export interface HavingReadonlyPropertyAbilities<GValue> extends HavingReadAbility<GValue>, HavingObserveAbility<GValue> {
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-readonly-property-abilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-readonly-property-abilities.js","sourceRoot":"","sources":["../../../../../src/combined/property/readonly/having-readonly-property-abilities.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { type MapFunction } from '@xstd/map-function';
2
+ import type { ObservableAsyncFunction } from '@xstd/observable-async-function';
3
+ import type { ReadAction } from '../../../individual/read/read-action.ts';
4
+ import type { HavingReadonlyPropertyAbilities } from './having-readonly-property-abilities.ts';
5
+ export declare class ReadonlyPropertyAbilities<GValue> implements HavingReadonlyPropertyAbilities<GValue> {
6
+ #private;
7
+ constructor({ read, observe }: HavingReadonlyPropertyAbilities<GValue>);
8
+ get read(): ReadAction<GValue>;
9
+ get observe(): ObservableAsyncFunction<GValue>;
10
+ map<GNewValue>(map: MapFunction<GValue, GNewValue>): ReadonlyPropertyAbilities<GNewValue>;
11
+ }
@@ -0,0 +1,22 @@
1
+ import {} from '@xstd/map-function';
2
+ export class ReadonlyPropertyAbilities {
3
+ #read;
4
+ #observe;
5
+ constructor({ read, observe }) {
6
+ this.#read = read;
7
+ this.#observe = observe;
8
+ }
9
+ get read() {
10
+ return this.#read;
11
+ }
12
+ get observe() {
13
+ return this.#observe;
14
+ }
15
+ map(map) {
16
+ return new ReadonlyPropertyAbilities({
17
+ read: this.#read.then(map),
18
+ observe: this.#observe.map(map),
19
+ });
20
+ }
21
+ }
22
+ //# sourceMappingURL=readonly-property-abilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readonly-property-abilities.js","sourceRoot":"","sources":["../../../../../src/combined/property/readonly/readonly-property-abilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,oBAAoB,CAAC;AAKtD,MAAM,OAAO,yBAAyB;IAC3B,KAAK,CAAqB;IAC1B,QAAQ,CAAkC;IAEnD,YAAY,EAAE,IAAI,EAAE,OAAO,EAA2C;QACpE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,GAAG,CAAY,GAAmC;QAChD,OAAO,IAAI,yBAAyB,CAAY;YAC9C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;YAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;CACF"}
package/src/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export * from './individual/write/having-write-ability.ts';
2
+ export * from './individual/write/write-action.ts';
3
+ export * from './individual/send/having-send-ability.ts';
4
+ export * from './individual/send/send-action.ts';
5
+ export * from './individual/read/having-read-ability.ts';
6
+ export * from './individual/read/read-action.ts';
7
+ export * from './individual/observe/having-observe-ability.ts';
8
+ export * from './individual/observe/observe-ability.ts';
9
+ export * from './combined/property/having-property-abilities.ts';
10
+ export * from './combined/property/property-abilities.ts';
11
+ export * from './combined/property/readonly/having-readonly-property-abilities.ts';
12
+ export * from './combined/property/readonly/readonly-property-abilities.ts';
13
+ export * from './combined/command/command-abilities.ts';
14
+ export * from './combined/command/having-command-abilities.ts';
package/src/index.js ADDED
@@ -0,0 +1,15 @@
1
+ export * from './individual/write/having-write-ability.js';
2
+ export * from './individual/write/write-action.js';
3
+ export * from './individual/send/having-send-ability.js';
4
+ export * from './individual/send/send-action.js';
5
+ export * from './individual/read/having-read-ability.js';
6
+ export * from './individual/read/read-action.js';
7
+ export * from './individual/observe/having-observe-ability.js';
8
+ export * from './individual/observe/observe-ability.js';
9
+ export * from './combined/property/having-property-abilities.js';
10
+ export * from './combined/property/property-abilities.js';
11
+ export * from './combined/property/readonly/having-readonly-property-abilities.js';
12
+ export * from './combined/property/readonly/readonly-property-abilities.js';
13
+ export * from './combined/command/command-abilities.js';
14
+ export * from './combined/command/having-command-abilities.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AACjE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oEAAoE,CAAC;AACnF,cAAc,6DAA6D,CAAC;AAC5E,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ObservableAsyncFunction } from '@xstd/observable-async-function';
2
+ export interface HavingObserveAbility<GValue, GArguments extends readonly unknown[] = []> {
3
+ readonly observe: ObservableAsyncFunction<GValue, GArguments>;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-observe-ability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-observe-ability.js","sourceRoot":"","sources":["../../../../src/individual/observe/having-observe-ability.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { ObservableAsyncFunction } from '@xstd/observable-async-function';
2
+ import type { HavingObserveAbility } from './having-observe-ability.ts';
3
+ export declare class ObserveAbility<GValue, GArguments extends readonly unknown[] = []> implements HavingObserveAbility<GValue, GArguments> {
4
+ #private;
5
+ constructor(observe: ObservableAsyncFunction<GValue, GArguments>);
6
+ get observe(): ObservableAsyncFunction<GValue, GArguments>;
7
+ }
@@ -0,0 +1,10 @@
1
+ export class ObserveAbility {
2
+ #observe;
3
+ constructor(observe) {
4
+ this.#observe = observe;
5
+ }
6
+ get observe() {
7
+ return this.#observe;
8
+ }
9
+ }
10
+ //# sourceMappingURL=observe-ability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observe-ability.js","sourceRoot":"","sources":["../../../../src/individual/observe/observe-ability.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IAIhB,QAAQ,CAA8C;IAE/D,YAAY,OAAoD;QAC9D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { ReadAction } from './read-action.ts';
2
+ export interface HavingReadAbility<GValue> {
3
+ readonly read: ReadAction<GValue>;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-read-ability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-read-ability.js","sourceRoot":"","sources":["../../../../src/individual/read/having-read-ability.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import type { AsyncFunction } from '@xstd/async-function';
2
+ export type ReadAction<GValue> = AsyncFunction<[], GValue>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=read-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-action.js","sourceRoot":"","sources":["../../../../src/individual/read/read-action.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { SendAction } from './send-action.ts';
2
+ export interface HavingSendAbility<GArguments extends readonly unknown[]> {
3
+ readonly send: SendAction<GArguments>;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-send-ability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-send-ability.js","sourceRoot":"","sources":["../../../../src/individual/send/having-send-ability.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import type { AsyncFunction } from '@xstd/async-function';
2
+ export type SendAction<GArguments extends readonly unknown[]> = AsyncFunction<GArguments, void>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=send-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-action.js","sourceRoot":"","sources":["../../../../src/individual/send/send-action.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { WriteAction } from './write-action.ts';
2
+ export interface HavingWriteAbility<GValue> {
3
+ readonly write: WriteAction<GValue>;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=having-write-ability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"having-write-ability.js","sourceRoot":"","sources":["../../../../src/individual/write/having-write-ability.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import type { AsyncFunction } from '@xstd/async-function';
2
+ export type WriteAction<GValue> = AsyncFunction<[GValue], void>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=write-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-action.js","sourceRoot":"","sources":["../../../../src/individual/write/write-action.ts"],"names":[],"mappings":""}