From f06a0a76f129a1d750367ae6a491141be74abb13 Mon Sep 17 00:00:00 2001 From: Gon Pombo Date: Mon, 26 Feb 2024 16:55:40 -0300 Subject: [PATCH] keep sdk comments so we can tag functions as deprecated (#902) * keep sdk comments so we can tag functions as deprecated * make some apis public --- .../etc/playground-assets.api.md | 149 +++--------------- .../@dcl/sdk/src/ethereum-provider/index.ts | 4 + packages/@dcl/sdk/src/internal/Observable.ts | 3 + packages/@dcl/sdk/tsconfig.json | 3 +- 4 files changed, 32 insertions(+), 127 deletions(-) diff --git a/packages/@dcl/playground-assets/etc/playground-assets.api.md b/packages/@dcl/playground-assets/etc/playground-assets.api.md index b0cbb80d1..78e932348 100644 --- a/packages/@dcl/playground-assets/etc/playground-assets.api.md +++ b/packages/@dcl/playground-assets/etc/playground-assets.api.md @@ -739,9 +739,7 @@ export function createEntityContainer(opts?: { reservedStaticEntities: number; }): IEntityContainer; -// Warning: (ae-missing-release-tag) "createEthereumProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export function createEthereumProvider(): { send(message: RPCSendableMessage, callback?: ((error: Error | null, result?: any) => void) | undefined): void; sendAsync(message: RPCSendableMessage, callback: (error: Error | null, result?: any) => void): void; @@ -956,8 +954,6 @@ export function Engine(options?: IEngineOptions): IEngine; // @public export const engine: IEngine; -// Warning: (ae-missing-release-tag) "EngineEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type EngineEvent = { type: T; @@ -1073,8 +1069,6 @@ export function getComponentEntityTree(engine: Pick; -// Warning: (ae-missing-release-tag) "GizmoDragEndEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GizmoDragEndEvent = { type: 'gizmoDragEnded'; @@ -1086,8 +1080,6 @@ export type GizmoDragEndEvent = { }>; }; -// Warning: (ae-missing-release-tag) "GizmoSelectedEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GizmoSelectedEvent = { type: 'gizmoSelected'; @@ -1107,8 +1099,6 @@ export type GlobalDirectionRaycastSystemOptions = { direction?: PBVector3; }; -// Warning: (ae-missing-release-tag) "GlobalInputEventResult" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GlobalInputEventResult = InputEventResult & { type: 0 | 1; @@ -1194,46 +1184,33 @@ export type IEntityContainer = { updateUsedEntity(entity: Entity): boolean; }; -// Warning: (ae-missing-release-tag) "IEventNames" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type IEventNames = keyof IEvents; -// Warning: (ae-missing-release-tag) "IEvents" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export interface IEvents { - // (undocumented) actionButtonEvent: GlobalInputEventResult; - // (undocumented) builderSceneStart: unknown; - // (undocumented) builderSceneUnloaded: unknown; - // (undocumented) cameraModeChanged: { cameraMode: 0 | 1 | 2; }; - // (undocumented) chatMessage: { id: string; sender: string; message: string; isCommand: boolean; }; - // (undocumented) comms: { sender: string; message: string; }; - // (undocumented) entitiesOutOfBoundaries: { entities: string[]; }; - // (undocumented) entityBackInScene: { entityId: unknown; }; - // (undocumented) entityOutOfScene: { entityId: unknown; }; @@ -1242,9 +1219,7 @@ export interface IEvents { type: string; [key: string]: any; }; - // (undocumented) gizmoEvent: GizmoDragEndEvent | GizmoSelectedEvent; - // (undocumented) idleStateChanged: { isIdle: boolean; }; @@ -1258,44 +1233,34 @@ export interface IEvents { given: Record; limit: Record; }; - // (undocumented) onAnimationEnd: { clipName: string; }; - // (undocumented) onBlur: { entityId: unknown; pointerId: number; }; - // (undocumented) onChange: { value?: any; pointerId?: number; }; - // (undocumented) onClick: { entityId: unknown; }; - // (undocumented) onEnter: unknown; - // (undocumented) onEnterScene: { userId: string; }; - // (undocumented) onFocus: { entityId: unknown; pointerId: number; }; - // (undocumented) onLeaveScene: { userId: string; }; - // (undocumented) onPointerLock: { locked?: boolean; }; - // (undocumented) onRealmChanged: { domain: string; room: string; @@ -1306,7 +1271,6 @@ export interface IEvents { onTextSubmit: { text: string; }; - // (undocumented) playerClicked: { userId: string; ray: { @@ -1315,11 +1279,9 @@ export interface IEvents { distance: number; }; }; - // (undocumented) playerConnected: { userId: string; }; - // (undocumented) playerDisconnected: { userId: string; }; @@ -1327,35 +1289,26 @@ export interface IEvents { playerExpression: { expressionId: string; }; - // (undocumented) pointerDown: InputEventResult; - // (undocumented) + // @deprecated pointerEvent: GlobalInputEventResult; - // (undocumented) pointerHoverEnter: unknown; - // (undocumented) pointerHoverExit: unknown; - // (undocumented) pointerUp: InputEventResult; - // (undocumented) positionChanged: { position: Vector3Type; cameraPosition: Vector3Type; playerHeight: number; }; - // (undocumented) profileChanged: { ethAddress: string; version: number; }; - // (undocumented) raycastResponse: RaycastResponsePayload; - // (undocumented) rotationChanged: { rotation: Vector3Type; quaternion: QuaternionType; }; - // (undocumented) sceneStart: unknown; // (undocumented) stateEvent: { @@ -1367,7 +1320,6 @@ export interface IEvents { uuid: string; payload: any; }; - // (undocumented) videoEvent: { componentId: string; videoClipId: string; @@ -1478,8 +1430,6 @@ export const enum InputAction { IA_WALK = 9 } -// Warning: (ae-missing-release-tag) "InputEventResult" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type InputEventResult = { origin: Vector3Type; @@ -1844,9 +1794,7 @@ export interface MeshRendererComponentDefinitionExtended extends LastWriteWinEle setSphere(entity: Entity): void; } -// Warning: (ae-missing-release-tag) "MessageBus" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @alpha @deprecated (undocumented) export class MessageBus { constructor(); // (undocumented) @@ -1950,98 +1898,65 @@ export const enum NftFrameType { // @public (undocumented) export const NftShape: LastWriteWinElementSetComponentDefinition; -// Warning: (ae-missing-release-tag) "Observable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated export class Observable { constructor(onObserverAdded?: (observer: Observer) => void); - // (undocumented) add(callback: (eventData: T, eventState: ObserverEventState) => void, mask?: number, insertFirst?: boolean, scope?: any, unregisterOnFirstCall?: boolean): null | Observer; - // (undocumented) addOnce(callback: (eventData: T, eventState: ObserverEventState) => void): null | Observer; - // (undocumented) clear(): void; - // (undocumented) clone(): Observable; - // (undocumented) hasObservers(): boolean; - // (undocumented) hasSpecificMask(mask?: number): boolean; - // (undocumented) notifyObserver(observer: Observer, eventData: T, mask?: number): void; - // (undocumented) notifyObservers(eventData: T, mask?: number, target?: any, currentTarget?: any): boolean; - // (undocumented) notifyObserversWithPromise(eventData: T, mask?: number, target?: any, currentTarget?: any): Promise; - // (undocumented) remove(observer: null | Observer): boolean; - // (undocumented) removeCallback(callback: (eventData: T, eventState: ObserverEventState) => void, scope?: any): boolean; } -// Warning: (ae-missing-release-tag) "Observer" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated export class Observer { - constructor(callback: (eventData: T, eventState: ObserverEventState) => void, mask: number, scope?: any); - // (undocumented) + constructor( + callback: (eventData: T, eventState: ObserverEventState) => void, + mask: number, + scope?: any); callback: (eventData: T, eventState: ObserverEventState) => void; - // (undocumented) mask: number; - // (undocumented) scope: any; - // (undocumented) unregisterOnNextCall: boolean; - // (undocumented) _willBeUnregistered: boolean; } -// Warning: (ae-missing-release-tag) "ObserverEventState" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated export class ObserverEventState { constructor(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any); - // (undocumented) currentTarget?: any; - // (undocumented) initalize(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any): ObserverEventState; - // (undocumented) lastReturnValue?: any; - // (undocumented) mask: number; - // (undocumented) skipNextObservers: boolean; - // (undocumented) target?: any; } // @public (undocumented) export type OnChangeFunction = (entity: Entity, operation: CrdtMessageType, component?: ComponentDefinition, componentValue?: any) => void; -// Warning: (ae-missing-release-tag) "onEnterScene" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onEnterScene: Observable<{ userId: string; }>; -// Warning: (ae-missing-release-tag) "onEnterSceneObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated export const onEnterSceneObservable: Observable<{ userId: string; }>; -// Warning: (ae-missing-release-tag) "onLeaveScene" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onLeaveScene: Observable<{ userId: string; }>; -// Warning: (ae-missing-release-tag) "onLeaveSceneObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated export const onLeaveSceneObservable: Observable<{ userId: string; }>; @@ -2056,9 +1971,7 @@ export type OnlyOptionalUndefinedTypes = { [K in IncludeUndefined]?: T[K]; }; -// Warning: (ae-missing-release-tag) "onPlayerClickedObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onPlayerClickedObservable: Observable<{ userId: string; ray: { @@ -2068,38 +1981,28 @@ export const onPlayerClickedObservable: Observable<{ }; }>; -// Warning: (ae-missing-release-tag) "onPlayerConnectedObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onPlayerConnectedObservable: Observable<{ userId: string; }>; -// Warning: (ae-missing-release-tag) "onPlayerDisconnectedObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onPlayerDisconnectedObservable: Observable<{ userId: string; }>; -// Warning: (ae-missing-release-tag) "onPlayerExpressionObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onPlayerExpressionObservable: Observable<{ expressionId: string; }>; -// Warning: (ae-missing-release-tag) "onProfileChanged" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onProfileChanged: Observable<{ ethAddress: string; version: number; }>; -// Warning: (ae-missing-release-tag) "onRealmChangedObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onRealmChangedObservable: Observable<{ domain: string; room: string; @@ -2107,9 +2010,7 @@ export const onRealmChangedObservable: Observable<{ displayName: string; }>; -// Warning: (ae-missing-release-tag) "onSceneReadyObservable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated export const onSceneReadyObservable: Observable; // Warning: (ae-missing-release-tag) "onUpdate" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -2117,9 +2018,7 @@ export const onSceneReadyObservable: Observable; // @public (undocumented) export function onUpdate(deltaTime: number): Promise; -// Warning: (ae-missing-release-tag) "onVideoEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public @deprecated (undocumented) export const onVideoEvent: Observable<{ componentId: string; videoClipId: string; @@ -3498,8 +3397,6 @@ export const enum RaycastQueryType { RQT_QUERY_ALL = 1 } -// Warning: (ae-missing-release-tag) "RaycastResponsePayload" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type RaycastResponsePayload = { queryId: string; diff --git a/packages/@dcl/sdk/src/ethereum-provider/index.ts b/packages/@dcl/sdk/src/ethereum-provider/index.ts index bbc3f22a4..63ecf83bf 100644 --- a/packages/@dcl/sdk/src/ethereum-provider/index.ts +++ b/packages/@dcl/sdk/src/ethereum-provider/index.ts @@ -18,6 +18,10 @@ import { sendAsync } from '~system/EthereumController' import { getEthereumProvider } from '../internal/provider' import { polyfillTextEncoder } from './text-encoder' +/** + * Etherum Provider + * @public + */ export function createEthereumProvider() { polyfillTextEncoder() return getEthereumProvider(sendAsync) diff --git a/packages/@dcl/sdk/src/internal/Observable.ts b/packages/@dcl/sdk/src/internal/Observable.ts index 9e341f2a9..61e7c35a8 100644 --- a/packages/@dcl/sdk/src/internal/Observable.ts +++ b/packages/@dcl/sdk/src/internal/Observable.ts @@ -2,6 +2,7 @@ /** * A class serves as a medium between the observable and its observers * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed + * @public */ export class ObserverEventState { /** @@ -61,6 +62,7 @@ export class ObserverEventState { /** * Represent an Observer registered to a given Observable object. * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed + * @public */ export class Observer { /** @@ -101,6 +103,7 @@ export class Observer { * For instance you may have a given Observable that have four different types of notifications: Move (mask = 0x01), Stop (mask = 0x02), Turn Right (mask = 0X04), Turn Left (mask = 0X08). * A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right. * + * @public * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed */ export class Observable { diff --git a/packages/@dcl/sdk/tsconfig.json b/packages/@dcl/sdk/tsconfig.json index f798a3a5a..7b3901b06 100644 --- a/packages/@dcl/sdk/tsconfig.json +++ b/packages/@dcl/sdk/tsconfig.json @@ -3,7 +3,8 @@ "esModuleInterop": true, "declaration": true, "stripInternal": true, - "outDir": "." + "outDir": ".", + "removeComments": false }, "include": ["src"], "exclude": ["dist"],