@fluidframework/type-factory 2.93.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.
- package/.mocharc.cjs +11 -0
- package/CHANGELOG.md +3 -0
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/alpha.d.ts +11 -0
- package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
- package/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-index.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-index.esm.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-extractor.json +14 -0
- package/api-report/type-factory.alpha.api.md +208 -0
- package/api-report/type-factory.beta.api.md +7 -0
- package/api-report/type-factory.public.api.md +7 -0
- package/dist/alpha.d.ts +57 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/methodBinding.d.ts +101 -0
- package/dist/methodBinding.d.ts.map +1 -0
- package/dist/methodBinding.js +26 -0
- package/dist/methodBinding.js.map +1 -0
- package/dist/package.json +4 -0
- package/dist/propertyBinding.d.ts +50 -0
- package/dist/propertyBinding.d.ts.map +1 -0
- package/dist/propertyBinding.js +13 -0
- package/dist/propertyBinding.js.map +1 -0
- package/dist/public.d.ts +16 -0
- package/dist/treeAgentTypes.d.ts +428 -0
- package/dist/treeAgentTypes.d.ts.map +1 -0
- package/dist/treeAgentTypes.js +218 -0
- package/dist/treeAgentTypes.js.map +1 -0
- package/eslint.config.mts +43 -0
- package/internal.d.ts +11 -0
- package/lib/alpha.d.ts +57 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -0
- package/lib/methodBinding.d.ts +101 -0
- package/lib/methodBinding.d.ts.map +1 -0
- package/lib/methodBinding.js +22 -0
- package/lib/methodBinding.js.map +1 -0
- package/lib/propertyBinding.d.ts +50 -0
- package/lib/propertyBinding.d.ts.map +1 -0
- package/lib/propertyBinding.js +10 -0
- package/lib/propertyBinding.js.map +1 -0
- package/lib/public.d.ts +16 -0
- package/lib/treeAgentTypes.d.ts +428 -0
- package/lib/treeAgentTypes.d.ts.map +1 -0
- package/lib/treeAgentTypes.js +214 -0
- package/lib/treeAgentTypes.js.map +1 -0
- package/lib/tsdoc-metadata.json +11 -0
- package/package.json +142 -0
- package/src/index.ts +57 -0
- package/src/methodBinding.ts +139 -0
- package/src/propertyBinding.ts +62 -0
- package/src/treeAgentTypes.ts +601 -0
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +14 -0
- package/tsdoc.json +4 -0
package/.mocharc.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
|
|
9
|
+
|
|
10
|
+
const config = getFluidTestMochaConfig(__dirname);
|
|
11
|
+
module.exports = config;
|
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# @fluidframework/type-factory
|
|
2
|
+
|
|
3
|
+
Shared types for exposing schema methods and properties to an LLM agent.
|
|
4
|
+
|
|
5
|
+
This package contains the type definitions and symbols used by `@fluidframework/tree-agent` to introspect
|
|
6
|
+
SharedTree schema classes and expose their methods/properties to LLMs.
|
|
7
|
+
|
|
8
|
+
See [the main Fluid Framework repo](https://github.com/microsoft/FluidFramework) for documentation.
|
|
9
|
+
|
|
10
|
+
<!-- AUTO-GENERATED-CONTENT:START (LIBRARY_README_HEADER) -->
|
|
11
|
+
|
|
12
|
+
<!-- prettier-ignore-start -->
|
|
13
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
14
|
+
|
|
15
|
+
## Using Fluid Framework libraries
|
|
16
|
+
|
|
17
|
+
When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
18
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
19
|
+
library consumers should always prefer `^`.
|
|
20
|
+
|
|
21
|
+
If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
To get started, install the package by running the following command:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm i @fluidframework/type-factory
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Importing from this package
|
|
32
|
+
|
|
33
|
+
This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
|
|
34
|
+
For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
|
|
35
|
+
|
|
36
|
+
To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/type-factory` like normal.
|
|
37
|
+
|
|
38
|
+
To access the `alpha` APIs, import via `@fluidframework/type-factory/alpha`.
|
|
39
|
+
|
|
40
|
+
## API Documentation
|
|
41
|
+
|
|
42
|
+
API documentation for **@fluidframework/type-factory** is available at <https://fluidframework.com/docs/apis/type-factory>.
|
|
43
|
+
|
|
44
|
+
<!-- prettier-ignore-end -->
|
|
45
|
+
|
|
46
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
47
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_FOOTER) -->
|
|
48
|
+
|
|
49
|
+
<!-- prettier-ignore-start -->
|
|
50
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
51
|
+
|
|
52
|
+
## Minimum Client Requirements
|
|
53
|
+
|
|
54
|
+
These are the platform requirements for the current version of Fluid Framework Client Packages.
|
|
55
|
+
These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
|
|
56
|
+
For Long Term Support (LTS) versions this can require supporting these platforms for several years.
|
|
57
|
+
|
|
58
|
+
It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
|
|
59
|
+
If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
|
|
60
|
+
When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
|
|
61
|
+
|
|
62
|
+
### Supported Runtimes
|
|
63
|
+
|
|
64
|
+
- NodeJs ^22.22.2 except that we will drop support for it [when NodeJs 22 loses its upstream support on 2027-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS at least 1 year before 22 is end-of-life.
|
|
65
|
+
- Running Fluid in a Node.js environment with the `--no-experimental-fetch` flag is not supported.
|
|
66
|
+
- Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
|
|
67
|
+
|
|
68
|
+
### Supported Tools
|
|
69
|
+
|
|
70
|
+
- TypeScript 5.4:
|
|
71
|
+
- All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
|
|
72
|
+
- [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
|
|
73
|
+
- [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
|
|
74
|
+
- `exactOptionalPropertyTypes` is currently not fully supported.
|
|
75
|
+
If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
|
|
76
|
+
- [webpack](https://webpack.js.org/) 5
|
|
77
|
+
- We are not intending to be prescriptive about what bundler to use.
|
|
78
|
+
Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
|
|
79
|
+
|
|
80
|
+
### Module Resolution
|
|
81
|
+
|
|
82
|
+
[`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
|
|
83
|
+
Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
|
|
84
|
+
|
|
85
|
+
### Module Formats
|
|
86
|
+
|
|
87
|
+
- ES Modules:
|
|
88
|
+
ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
|
|
89
|
+
- CommonJs:
|
|
90
|
+
Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
|
|
91
|
+
This is done to accommodate some workflows without good ES Module support.
|
|
92
|
+
If you have a workflow you would like included in this list, file an issue.
|
|
93
|
+
Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
|
|
94
|
+
|
|
95
|
+
- Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
|
|
96
|
+
|
|
97
|
+
## Contribution Guidelines
|
|
98
|
+
|
|
99
|
+
There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
|
|
100
|
+
|
|
101
|
+
- Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
|
|
102
|
+
- [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
|
|
103
|
+
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
104
|
+
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
105
|
+
|
|
106
|
+
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
|
|
107
|
+
|
|
108
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
109
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
110
|
+
|
|
111
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
112
|
+
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
|
|
113
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
114
|
+
|
|
115
|
+
## Help
|
|
116
|
+
|
|
117
|
+
Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
118
|
+
|
|
119
|
+
Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
|
|
120
|
+
|
|
121
|
+
Thank you!
|
|
122
|
+
|
|
123
|
+
## Trademark
|
|
124
|
+
|
|
125
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
126
|
+
|
|
127
|
+
Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
128
|
+
|
|
129
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
130
|
+
|
|
131
|
+
<!-- prettier-ignore-end -->
|
|
132
|
+
|
|
133
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
package/alpha.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export * from "./lib/alpha.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/alpha.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.esm.no-legacy.json",
|
|
4
|
+
"compiler": {
|
|
5
|
+
// api-extractor has trouble with Node16 moduleResolution, but Bundler looks okay.
|
|
6
|
+
"overrideTsconfig": {
|
|
7
|
+
"$schema": "http://json.schemastore.org/tsconfig",
|
|
8
|
+
"extends": "./tsconfig.json",
|
|
9
|
+
"compilerOptions": {
|
|
10
|
+
"moduleResolution": "Bundler"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
## Alpha API Report File for "@fluidframework/type-factory"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @alpha
|
|
8
|
+
export type Arg<T extends TypeFactoryType = TypeFactoryType> = readonly [
|
|
9
|
+
name: string,
|
|
10
|
+
type: T
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
// @alpha
|
|
14
|
+
export type ArgsTuple<T extends readonly Arg[]> = T extends readonly [infer Single extends Arg] ? [Single[1]] : T extends readonly [infer Head extends Arg, ...infer Tail extends readonly Arg[]] ? [Head[1], ...ArgsTuple<Tail>] : never;
|
|
15
|
+
|
|
16
|
+
// @alpha
|
|
17
|
+
export function buildFunc<const Return extends TypeFactoryType, const Args extends readonly Arg[], const Rest extends TypeFactoryType | null = null>(def: {
|
|
18
|
+
description?: string;
|
|
19
|
+
returns: Return;
|
|
20
|
+
rest?: Rest;
|
|
21
|
+
}, ...args: Args): FunctionDef<Args, Return, Rest>;
|
|
22
|
+
|
|
23
|
+
// @alpha
|
|
24
|
+
export type Ctor<T = any> = new (...args: any[]) => T;
|
|
25
|
+
|
|
26
|
+
// @alpha
|
|
27
|
+
export interface ExposedMethods {
|
|
28
|
+
expose<const K extends string & keyof MethodKeys<InstanceType<S>>, S extends Ctor & IExposedMethods, Z extends FunctionDef<readonly Arg[], TypeFactoryType, TypeFactoryType | null>>(constructor: S, methodName: K, tfFunction: Z): void;
|
|
29
|
+
exposeMethod<const K extends string & keyof MethodKeys<InstanceType<S>>, S extends Ctor & IExposedMethods, Z extends FunctionDef<readonly Arg[], TypeFactoryType, TypeFactoryType | null>>(constructor: S, methodName: K, tfFunction: Z): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// @alpha
|
|
33
|
+
export interface ExposedProperties {
|
|
34
|
+
exposeProperty<S extends Ctor, K extends string>(constructor: S, name: K, def: {
|
|
35
|
+
schema: TypeFactoryType;
|
|
36
|
+
description?: string;
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
}): void;
|
|
39
|
+
exposeProperty<S extends Ctor, K extends string>(constructor: S, name: K, tfType: TypeFactoryType): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// @alpha
|
|
43
|
+
export const exposeMethodsSymbol: unique symbol;
|
|
44
|
+
|
|
45
|
+
// @alpha
|
|
46
|
+
export const exposePropertiesSymbol: unique symbol;
|
|
47
|
+
|
|
48
|
+
// @alpha
|
|
49
|
+
export interface FunctionDef<Args extends readonly Arg[], Return extends TypeFactoryType, Rest extends TypeFactoryType | null = null> {
|
|
50
|
+
args: Args;
|
|
51
|
+
description?: string;
|
|
52
|
+
rest?: Rest;
|
|
53
|
+
returns: Return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// @alpha
|
|
57
|
+
export interface IExposedMethods {
|
|
58
|
+
[exposeMethodsSymbol](methods: ExposedMethods): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// @alpha
|
|
62
|
+
export interface IExposedProperties {
|
|
63
|
+
[exposePropertiesSymbol]?(properties: ExposedProperties): void;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// @alpha
|
|
67
|
+
export function isTypeFactoryType(value: unknown): value is TypeFactoryType;
|
|
68
|
+
|
|
69
|
+
// @alpha
|
|
70
|
+
export type MethodKeys<T> = {
|
|
71
|
+
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// @alpha
|
|
75
|
+
export interface TypeFactoryArray extends TypeFactoryType {
|
|
76
|
+
readonly element: TypeFactoryType;
|
|
77
|
+
readonly _kind: "array";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// @alpha
|
|
81
|
+
export interface TypeFactoryBoolean extends TypeFactoryType {
|
|
82
|
+
readonly _kind: "boolean";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// @alpha
|
|
86
|
+
export interface TypeFactoryDate extends TypeFactoryType {
|
|
87
|
+
readonly _kind: "date";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// @alpha
|
|
91
|
+
export interface TypeFactoryFunction extends TypeFactoryType {
|
|
92
|
+
readonly _kind: "function";
|
|
93
|
+
readonly parameters: readonly TypeFactoryFunctionParameter[];
|
|
94
|
+
readonly restParameter?: TypeFactoryFunctionParameter;
|
|
95
|
+
readonly returnType: TypeFactoryType;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// @alpha
|
|
99
|
+
export type TypeFactoryFunctionParameter = readonly [name: string, type: TypeFactoryType];
|
|
100
|
+
|
|
101
|
+
// @alpha
|
|
102
|
+
export interface TypeFactoryInstanceOf extends TypeFactoryType {
|
|
103
|
+
readonly constructor: new (...args: any[]) => unknown;
|
|
104
|
+
readonly _kind: "instanceof";
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// @alpha
|
|
108
|
+
export interface TypeFactoryIntersection extends TypeFactoryType {
|
|
109
|
+
readonly _kind: "intersection";
|
|
110
|
+
readonly types: readonly TypeFactoryType[];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// @alpha
|
|
114
|
+
export interface TypeFactoryLiteral extends TypeFactoryType {
|
|
115
|
+
readonly _kind: "literal";
|
|
116
|
+
readonly value: string | number | boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// @alpha
|
|
120
|
+
export interface TypeFactoryMap extends TypeFactoryType {
|
|
121
|
+
readonly keyType: TypeFactoryType;
|
|
122
|
+
readonly _kind: "map";
|
|
123
|
+
readonly valueType: TypeFactoryType;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// @alpha
|
|
127
|
+
export interface TypeFactoryNull extends TypeFactoryType {
|
|
128
|
+
readonly _kind: "null";
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// @alpha
|
|
132
|
+
export interface TypeFactoryNumber extends TypeFactoryType {
|
|
133
|
+
readonly _kind: "number";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// @alpha
|
|
137
|
+
export interface TypeFactoryObject extends TypeFactoryType {
|
|
138
|
+
readonly _kind: "object";
|
|
139
|
+
readonly shape: Record<string, TypeFactoryType>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// @alpha
|
|
143
|
+
export interface TypeFactoryOptional extends TypeFactoryType {
|
|
144
|
+
readonly innerType: TypeFactoryType;
|
|
145
|
+
readonly _kind: "optional";
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// @alpha
|
|
149
|
+
export interface TypeFactoryPromise extends TypeFactoryType {
|
|
150
|
+
readonly innerType: TypeFactoryType;
|
|
151
|
+
readonly _kind: "promise";
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// @alpha
|
|
155
|
+
export interface TypeFactoryReadonly extends TypeFactoryType {
|
|
156
|
+
readonly innerType: TypeFactoryType;
|
|
157
|
+
readonly _kind: "readonly";
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// @alpha
|
|
161
|
+
export interface TypeFactoryRecord extends TypeFactoryType {
|
|
162
|
+
readonly keyType: TypeFactoryType;
|
|
163
|
+
readonly _kind: "record";
|
|
164
|
+
readonly valueType: TypeFactoryType;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// @alpha
|
|
168
|
+
export interface TypeFactoryString extends TypeFactoryType {
|
|
169
|
+
readonly _kind: "string";
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// @alpha
|
|
173
|
+
export interface TypeFactoryTuple extends TypeFactoryType {
|
|
174
|
+
readonly items: readonly TypeFactoryType[];
|
|
175
|
+
readonly _kind: "tuple";
|
|
176
|
+
readonly rest?: TypeFactoryType;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// @alpha
|
|
180
|
+
export interface TypeFactoryType {
|
|
181
|
+
readonly _kind: TypeFactoryTypeKind;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// @alpha
|
|
185
|
+
export type TypeFactoryTypeKind = "string" | "number" | "boolean" | "void" | "undefined" | "null" | "unknown" | "date" | "promise" | "array" | "object" | "record" | "map" | "tuple" | "union" | "intersection" | "literal" | "optional" | "readonly" | "function" | "instanceof";
|
|
186
|
+
|
|
187
|
+
// @alpha
|
|
188
|
+
export interface TypeFactoryUndefined extends TypeFactoryType {
|
|
189
|
+
readonly _kind: "undefined";
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// @alpha
|
|
193
|
+
export interface TypeFactoryUnion extends TypeFactoryType {
|
|
194
|
+
readonly _kind: "union";
|
|
195
|
+
readonly options: readonly TypeFactoryType[];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// @alpha
|
|
199
|
+
export interface TypeFactoryUnknown extends TypeFactoryType {
|
|
200
|
+
readonly _kind: "unknown";
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// @alpha
|
|
204
|
+
export interface TypeFactoryVoid extends TypeFactoryType {
|
|
205
|
+
readonly _kind: "void";
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
```
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist" in @fluid-tools/build-cli.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Shared types for exposing schema methods and properties to an LLM agent.
|
|
13
|
+
*
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
// #region @alpha APIs
|
|
19
|
+
Arg,
|
|
20
|
+
ArgsTuple,
|
|
21
|
+
Ctor,
|
|
22
|
+
ExposedMethods,
|
|
23
|
+
ExposedProperties,
|
|
24
|
+
FunctionDef,
|
|
25
|
+
IExposedMethods,
|
|
26
|
+
IExposedProperties,
|
|
27
|
+
MethodKeys,
|
|
28
|
+
TypeFactoryArray,
|
|
29
|
+
TypeFactoryBoolean,
|
|
30
|
+
TypeFactoryDate,
|
|
31
|
+
TypeFactoryFunction,
|
|
32
|
+
TypeFactoryFunctionParameter,
|
|
33
|
+
TypeFactoryInstanceOf,
|
|
34
|
+
TypeFactoryIntersection,
|
|
35
|
+
TypeFactoryLiteral,
|
|
36
|
+
TypeFactoryMap,
|
|
37
|
+
TypeFactoryNull,
|
|
38
|
+
TypeFactoryNumber,
|
|
39
|
+
TypeFactoryObject,
|
|
40
|
+
TypeFactoryOptional,
|
|
41
|
+
TypeFactoryPromise,
|
|
42
|
+
TypeFactoryReadonly,
|
|
43
|
+
TypeFactoryRecord,
|
|
44
|
+
TypeFactoryString,
|
|
45
|
+
TypeFactoryTuple,
|
|
46
|
+
TypeFactoryType,
|
|
47
|
+
TypeFactoryTypeKind,
|
|
48
|
+
TypeFactoryUndefined,
|
|
49
|
+
TypeFactoryUnion,
|
|
50
|
+
TypeFactoryUnknown,
|
|
51
|
+
TypeFactoryVoid,
|
|
52
|
+
buildFunc,
|
|
53
|
+
exposeMethodsSymbol,
|
|
54
|
+
exposePropertiesSymbol,
|
|
55
|
+
isTypeFactoryType
|
|
56
|
+
// #endregion
|
|
57
|
+
} from "./index.js";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Shared types for exposing schema methods and properties to an LLM agent.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { buildFunc, exposeMethodsSymbol, type ExposedMethods, type Arg, type ArgsTuple, type FunctionDef, type MethodKeys, type Ctor, type IExposedMethods, } from "./methodBinding.js";
|
|
11
|
+
export { exposePropertiesSymbol, type ExposedProperties, type IExposedProperties, } from "./propertyBinding.js";
|
|
12
|
+
export { typeFactory, isTypeFactoryType } from "./treeAgentTypes.js";
|
|
13
|
+
export type { TypeFactoryType, TypeFactoryTypeKind, TypeFactoryString, TypeFactoryNumber, TypeFactoryBoolean, TypeFactoryDate, TypeFactoryVoid, TypeFactoryUndefined, TypeFactoryNull, TypeFactoryUnknown, TypeFactoryArray, TypeFactoryPromise, TypeFactoryObject, TypeFactoryRecord, TypeFactoryMap, TypeFactoryTuple, TypeFactoryUnion, TypeFactoryIntersection, TypeFactoryLiteral, TypeFactoryOptional, TypeFactoryReadonly, TypeFactoryFunction, TypeFactoryFunctionParameter, TypeFactoryInstanceOf, } from "./treeAgentTypes.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACN,SAAS,EACT,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,GAAG,EACR,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,eAAe,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAErE,YAAY,EACX,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,qBAAqB,GACrB,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isTypeFactoryType = exports.typeFactory = exports.exposePropertiesSymbol = exports.exposeMethodsSymbol = exports.buildFunc = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Shared types for exposing schema methods and properties to an LLM agent.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
var methodBinding_js_1 = require("./methodBinding.js");
|
|
14
|
+
Object.defineProperty(exports, "buildFunc", { enumerable: true, get: function () { return methodBinding_js_1.buildFunc; } });
|
|
15
|
+
Object.defineProperty(exports, "exposeMethodsSymbol", { enumerable: true, get: function () { return methodBinding_js_1.exposeMethodsSymbol; } });
|
|
16
|
+
var propertyBinding_js_1 = require("./propertyBinding.js");
|
|
17
|
+
Object.defineProperty(exports, "exposePropertiesSymbol", { enumerable: true, get: function () { return propertyBinding_js_1.exposePropertiesSymbol; } });
|
|
18
|
+
var treeAgentTypes_js_1 = require("./treeAgentTypes.js");
|
|
19
|
+
Object.defineProperty(exports, "typeFactory", { enumerable: true, get: function () { return treeAgentTypes_js_1.typeFactory; } });
|
|
20
|
+
Object.defineProperty(exports, "isTypeFactoryType", { enumerable: true, get: function () { return treeAgentTypes_js_1.isTypeFactoryType; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,uDAU4B;AAT3B,6GAAA,SAAS,OAAA;AACT,uHAAA,mBAAmB,OAAA;AAUpB,2DAI8B;AAH7B,4HAAA,sBAAsB,OAAA;AAKvB,yDAAqE;AAA5D,gHAAA,WAAW,OAAA;AAAE,sHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Shared types for exposing schema methods and properties to an LLM agent.\n *\n * @packageDocumentation\n */\n\nexport {\n\tbuildFunc,\n\texposeMethodsSymbol,\n\ttype ExposedMethods,\n\ttype Arg,\n\ttype ArgsTuple,\n\ttype FunctionDef,\n\ttype MethodKeys,\n\ttype Ctor,\n\ttype IExposedMethods,\n} from \"./methodBinding.js\";\n\nexport {\n\texposePropertiesSymbol,\n\ttype ExposedProperties,\n\ttype IExposedProperties,\n} from \"./propertyBinding.js\";\n\nexport { typeFactory, isTypeFactoryType } from \"./treeAgentTypes.js\";\n\nexport type {\n\tTypeFactoryType,\n\tTypeFactoryTypeKind,\n\tTypeFactoryString,\n\tTypeFactoryNumber,\n\tTypeFactoryBoolean,\n\tTypeFactoryDate,\n\tTypeFactoryVoid,\n\tTypeFactoryUndefined,\n\tTypeFactoryNull,\n\tTypeFactoryUnknown,\n\tTypeFactoryArray,\n\tTypeFactoryPromise,\n\tTypeFactoryObject,\n\tTypeFactoryRecord,\n\tTypeFactoryMap,\n\tTypeFactoryTuple,\n\tTypeFactoryUnion,\n\tTypeFactoryIntersection,\n\tTypeFactoryLiteral,\n\tTypeFactoryOptional,\n\tTypeFactoryReadonly,\n\tTypeFactoryFunction,\n\tTypeFactoryFunctionParameter,\n\tTypeFactoryInstanceOf,\n} from \"./treeAgentTypes.js\";\n"]}
|