Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree2: remove @alpha tags #18895

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
518 changes: 259 additions & 259 deletions packages/dds/tree/api-report/tree.api.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/dds/tree/src/class-tree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import * as InternalClassTreeTypes from "./internal";
export { InternalClassTreeTypes };

// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
// These are `@alpha` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
export {
RecursiveObject as test_RecursiveObject,
base as test_RecursiveObject_base,
Expand Down
8 changes: 4 additions & 4 deletions packages/dds/tree/src/class-tree/schemaCreationUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { NodeFromSchema, type NodeKind as _dummy } from "./schemaTypes";
* @remarks
* This is commonly used in unions when the only information needed is which kind of node the value is.
* Enums are a common example of this pattern.
* @alpha
* @internal
*/
export function singletonSchema<TScope extends string, TName extends string | number>(
factory: SchemaFactory<TScope, TName>,
Expand Down Expand Up @@ -58,7 +58,7 @@ export function singletonSchema<TScope extends string, TName extends string | nu
* Extends this to support numeric enums.
* Maybe require an explicit nested scope to group them under, or at least a warning about collisions.
* Maybe just provide `SchemaFactory.nested` to east creating nested scopes?
* @alpha
* @internal
*/
export function adaptEnum<TScope extends string, const TEnum extends Record<string, string>>(
factory: SchemaFactory<TScope>,
Expand Down Expand Up @@ -100,7 +100,7 @@ export function adaptEnum<TScope extends string, const TEnum extends Record<stri

/**
* `Object.values`, but with more specific types.
* @alpha
* @internal
*/
export function typedObjectValues<TKey extends string, TValues>(
object: Record<TKey, TValues>,
Expand All @@ -125,7 +125,7 @@ export function typedObjectValues<TKey extends string, TValues>(
*
* class Parent extends schemaFactory.object("Parent", { mode: typedObjectValues(Mode) }) {}
* ```
* @alpha
* @internal
*/
export function enumFromStrings<TScope extends string, const Members extends string>(
factory: SchemaFactory<TScope>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { SchemaFactory } from "./schemaFactory";
*
* @remarks This is separated from SchemaFactory as these APIs are more experimental, and may be stabilized independently.
*
* @sealed @alpha
* @sealed @internal
*/
export class SchemaFactoryRecursive<
TScope extends string,
Expand Down
4 changes: 2 additions & 2 deletions packages/dds/tree/src/class-tree/testRecursiveDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ builder.fixRecursiveReference(recursiveReference);
* Fix API-Extractor to support class based schema, and remove this workaround (inline this type into `RecursiveObject extends` below).
* Error: src/class-tree/testRecursiveDomain.ts:32:1 - (ae-forgotten-export) The symbol "RecursiveObject_base" needs to be exported by the entry point index.d.ts
* See https://github.com/microsoft/rushstack/issues/4429
* @alpha
* @internal
*/
export const base = builder.object("testObject", {
recursive: builder.optional([recursiveReference]),
number: builder.number,
});

/**
* @alpha
* @internal
*/
export class RecursiveObject extends base {}
6 changes: 3 additions & 3 deletions packages/dds/tree/src/codec/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface IDecoder<TDecoded, TEncoded> {
/**
* Validates data complies with some particular schema.
* Implementations are typically created by a {@link JsonValidator}.
* @alpha
* @internal
*/
export interface SchemaValidationFunction<Schema extends TSchema> {
/**
Expand All @@ -44,7 +44,7 @@ export interface SchemaValidationFunction<Schema extends TSchema> {

/**
* JSON schema validator compliant with draft 6 schema. See https://json-schema.org.
* @alpha
* @internal
*/
export interface JsonValidator {
/**
Expand All @@ -61,7 +61,7 @@ export interface JsonValidator {

/**
* Options relating to handling of persisted data.
* @alpha
* @internal
*/
export interface ICodecOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dds/tree/src/codec/noopValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { JsonValidator } from "./codec";
* A {@link JsonValidator} implementation which performs no validation and accepts all data as valid.
* @privateRemarks Having this as an option unifies opting out of validation with selection of
* validators, simplifying code performing validation.
* @alpha
* @internal
*/
export const noopValidator: JsonValidator = {
compile: <Schema extends TSchema>() => ({ check: (data): data is Static<Schema> => true }),
Expand Down
8 changes: 4 additions & 4 deletions packages/dds/tree/src/core/forest/editableForest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { IForestSubscription, ITreeSubscriptionCursor } from "./forest";

/**
* Editing APIs.
* @alpha
* @internal
*/
export interface IEditableForest extends IForestSubscription {
/**
Expand Down Expand Up @@ -55,12 +55,12 @@ export function initializeForest(

/**
* Ways to refer to a node in an IEditableForest.
* @alpha
* @internal
*/
export type ForestLocation = ITreeSubscriptionCursor | Anchor;

/**
* @alpha
* @internal
*/
export interface TreeLocation {
readonly range: FieldLocation | DetachedField;
Expand All @@ -73,7 +73,7 @@ export function isFieldLocation(range: FieldLocation | DetachedField): range is

/**
* Location of a field within a tree that is not a detached/root field.
* @alpha
* @internal
*/
export interface FieldLocation {
readonly key: FieldKey;
Expand Down
12 changes: 6 additions & 6 deletions packages/dds/tree/src/core/forest/forest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import type { IEditableForest } from "./editableForest";
* Events for {@link IForestSubscription}.
*
* TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).
* @alpha
* @internal
*/
export interface ForestEvents {
/**
Expand All @@ -53,7 +53,7 @@ export interface ForestEvents {
* Not invalidated when schema changes.
*
* When invalidating, all outstanding cursors must be freed or cleared.
* @alpha
* @internal
*/
export interface IForestSubscription extends ISubscribable<ForestEvents> {
/**
Expand Down Expand Up @@ -156,7 +156,7 @@ export function moveToDetachedField(
/**
* Anchor to a field.
* This is structurally based on the parent, so it will move only as the parent moves.
* @alpha
* @internal
*/
export interface FieldAnchor {
/**
Expand All @@ -169,7 +169,7 @@ export interface FieldAnchor {

/**
* ITreeCursor supporting IForestSubscription and its changes over time.
* @alpha
* @internal
*/
export interface ITreeSubscriptionCursor extends ITreeCursor {
/**
Expand Down Expand Up @@ -219,7 +219,7 @@ export interface ITreeSubscriptionCursor extends ITreeCursor {
}

/**
* @alpha
* @internal
*/
export enum ITreeSubscriptionCursorState {
/**
Expand All @@ -237,7 +237,7 @@ export enum ITreeSubscriptionCursorState {
}

/**
* @alpha
* @internal
*/
export const enum TreeNavigationResult {
/**
Expand Down
8 changes: 4 additions & 4 deletions packages/dds/tree/src/core/rebase/changeRebaser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export interface ChangeRebaser<TChangeset> {
}

/**
* @alpha
* @internal
*/
export interface TaggedChange<TChangeset> {
readonly revision: RevisionTag | undefined;
Expand Down Expand Up @@ -113,12 +113,12 @@ export function mapTaggedChange<TIn, TOut>(
* being produced.
*
* During rebase, the indices of the base changes are all lower than the indices of the change being rebased.
* @alpha
* @internal
*/
export type RevisionIndexer = (tag: RevisionTag) => number | undefined;

/**
* @alpha
* @internal
*/
export interface RevisionMetadataSource {
readonly getIndex: RevisionIndexer;
Expand All @@ -127,7 +127,7 @@ export interface RevisionMetadataSource {
}

/**
* @alpha
* @internal
*/
export interface RevisionInfo {
readonly revision: RevisionTag;
Expand Down
10 changes: 5 additions & 5 deletions packages/dds/tree/src/core/rebase/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const SessionIdSchema = brandedStringType<SessionId>();
/**
* A unique identifier for a commit. Commits that have been rebased, but are semantically
* the same, will share the same revision tag.
* @alpha
* @internal
*/
// TODO: These can be compressed by an `IdCompressor` in the future
export type RevisionTag = StableId;
Expand All @@ -27,13 +27,13 @@ export const RevisionTagSchema = brandedStringType<EncodedRevisionTag>();
* An ID which is unique within a revision of a `ModularChangeset`.
* A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,
* but they are unique when qualified by the revision of the change they are used in.
* @alpha
* @internal
*/
export type ChangesetLocalId = Brand<number, "ChangesetLocalId">;

/**
* A globally unique ID for an atom of change, or a node associated with the atom of change.
* @alpha
* @internal
*
* @privateRemarks
* TODO: Rename this to be more general.
Expand All @@ -56,12 +56,12 @@ export interface EncodedChangeAtomId {
}

/**
* @alpha
* @internal
*/
export type ChangeAtomIdMap<T> = NestedMap<RevisionTag | undefined, ChangesetLocalId, T>;

/**
* @alpha
* @internal
*/
export type ChangeAtomIdRangeMap<T> = Map<RevisionTag | undefined, RangeMap<T>>;

Expand Down
2 changes: 1 addition & 1 deletion packages/dds/tree/src/core/rebase/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export function rebaseChange<TChange>(
}

/**
* @alpha
* @internal
*/
export function revisionMetadataSourceFromInfo(
revInfos: readonly RevisionInfo[],
Expand Down
22 changes: 11 additions & 11 deletions packages/dds/tree/src/core/schema-stored/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Brand, brand, brandedStringType } from "../../util";
* Also known as "Definition"
*
* Stable identifier, used when persisting data.
* @alpha
* @internal
*/
export type TreeNodeSchemaIdentifier<TName extends string = string> = Brand<
TName,
Expand All @@ -26,7 +26,7 @@ export const TreeNodeSchemaIdentifierSchema = brandedStringType<TreeNodeSchemaId
* Key (aka Name or Label) for a field which is scoped to a specific TreeNodeStoredSchema.
*
* Stable identifier, used when persisting data.
* @alpha
* @internal
*/
export type FieldKey = Brand<string, "tree.FieldKey">;

Expand All @@ -40,14 +40,14 @@ export const FieldKeySchema = brandedStringType<FieldKey>();
* Refers to an exact stable policy (ex: specific version of a policy),
* for how to handle (ex: edit and merge edits to) fields marked with this kind.
* Persisted in documents as part of stored schema.
* @alpha
* @internal
*/
export type FieldKindIdentifier = Brand<string, "tree.FieldKindIdentifier">;
export const FieldKindIdentifierSchema = brandedStringType<FieldKindIdentifier>();

/**
* Schema for what {@link TreeValue} is allowed on a Leaf node.
* @alpha
* @internal
*/
export enum ValueSchema {
Number,
Expand Down Expand Up @@ -85,7 +85,7 @@ export enum ValueSchema {
* - Constrain the types allowed based on which types guarantee their data will always meet the constraints.
*
* Care would need to be taken to make sure this is sound for the schema updating mechanisms.
* @alpha
* @internal
*/
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier> | undefined;

Expand All @@ -95,14 +95,14 @@ export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier> | undefined;
* @remarks
* This is used instead of just the FieldKindIdentifier so that it can be subtyped into a more expressive type with additional information.
*
* @alpha
* @internal
*/
export interface FieldKindSpecifier<T = FieldKindIdentifier> {
identifier: T;
}

/**
* @alpha
* @internal
*/
export interface TreeFieldStoredSchema {
readonly kind: FieldKindSpecifier;
Expand All @@ -121,7 +121,7 @@ export interface TreeFieldStoredSchema {
* 1. The root default field for documents.
* 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.
*
* @alpha
* @internal
*/
export const forbiddenFieldKindIdentifier = "Forbidden";

Expand All @@ -137,7 +137,7 @@ export const storedEmptyFieldSchema: TreeFieldStoredSchema = {
};

/**
* @alpha
* @internal
*/
export interface TreeNodeStoredSchema {
/**
Expand Down Expand Up @@ -184,7 +184,7 @@ export interface TreeNodeStoredSchema {
* @remarks
* Note: the owner of this may modify it over time:
* thus if needing to hand onto a specific version, make a copy.
* @alpha
* @internal
*/
export interface TreeStoredSchema extends StoredSchemaCollection {
/**
Expand All @@ -199,7 +199,7 @@ export interface TreeStoredSchema extends StoredSchemaCollection {
* @remarks
* Note: the owner of this may modify it over time:
* thus if needing to hang onto a specific version, make a copy.
* @alpha
* @internal
*/
export interface StoredSchemaCollection {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
* Events for {@link TreeStoredSchemaSubscription}.
*
* TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).
* @alpha
* @internal
*/
export interface SchemaEvents {
/**
Expand All @@ -35,15 +35,15 @@ export interface SchemaEvents {

/**
* A collection of stored schema that fires events in response to changes.
* @alpha
* @internal
*/
export interface TreeStoredSchemaSubscription
extends ISubscribable<SchemaEvents>,
TreeStoredSchema {}

/**
* Mutable collection of stored schema.
* @alpha
* @internal
*/
export interface MutableTreeStoredSchema extends TreeStoredSchemaSubscription {
/**
Expand Down
Loading
Loading