diff --git a/.vscode/snippets.code-snippets b/.vscode/snippets.code-snippets new file mode 100644 index 00000000..e74538c8 --- /dev/null +++ b/.vscode/snippets.code-snippets @@ -0,0 +1,11 @@ +{ + "Add experimental message": { + "scope": "javascript,typescript", + // kpd = KAPLAY Development + "prefix": "kpd-experimental", + "body": [ + "@experimental This feature is in experimental phase, it will be fully released in $1", + ], + "description": "Add @experimental tag in JSDoc" + } +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e26137e..438650c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,13 +45,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added - Added tags and components separation in `KAPLAYOpt.tagsAsComponents` - **experimental** + (**experimental**) - Added `.is()`, `.tag()` and `.untag()` to `GameObjRaw`, check, add and remove + (**experimental**) - Added `.has()` to `GameObjRaw`, to check if a game object has a component tags - **experimental** + (**experimental**) - Added events for listen to comps being removed or added `onUse()` and - `onUnused()` **experimental** -- Added `k.cancel()` to cancel the current event **experimental** + `onUnused()` (**experimental**) +- Added `k.cancel()` to cancel the current event (**experimental**) - ```js onKeyPress("space", () => { // do something @@ -59,9 +60,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). return cancel(); }); ``` -- Added `getDefaultLayer()` to get the default layer (experimental) - **experimental** -- Added `getLayers()` to get the layers list (experimental) **experimental** +- Added `getDefaultLayer()` to get the default layer (**experimental**) +- Added `getLayers()` to get the layers list (**experimental**) - Added many JSDoc specifiers on many functions (@require, @deprecated, @since, @group, etc) @@ -69,7 +69,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Added `.use()`, `.unuse()` and `.has()` to `GameObjRaw`, to add, remove and check components. This only works with `KAPLAYOpt.tagsAsComponents` set to - `true` **experimental** + `true` (**experimental**) ### Deprecated diff --git a/src/types.ts b/src/types.ts index 1c27f010..3c4b64bb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4384,14 +4384,16 @@ export interface KAPLAYCtx< * @returns The layer names or null if not set. * @since v3001.1 * @group Layers + * @experimental This feature is in experimental phase, it will be fully released in v3001.1 */ getLayers(): string[] | null; /** * Get the default layer name. * * @returns The default layer name or null if not set. - * @since v3001.1 + * @since v3001.0.5 * @group Layers + * @experimental This feature is in experimental phase, it will be fully released in v3001.1 */ getDefaultLayer(): string | null; /** @@ -5098,8 +5100,9 @@ export interface KAPLAYCtx< * ``` * * @returns The cancel event symbol. - * @since v3001.1 + * @since v3001.0.5 * @group Events + * @experimental This feature is in experimental phase, it will be fully released in v3001.1.0 */ cancel: () => Symbol; /** @@ -5431,6 +5434,7 @@ export interface KAPLAYOpt< * That means .is() will return true for components with that id. * * @default true + * @experimental This feature is in experimental phase, it will be fully released in v3001.1.0 */ tagsAsComponents?: boolean; } @@ -5619,7 +5623,8 @@ export interface GameObjRaw { * ``` * * @returns true if has the component(s), false otherwise. - * @since v3001.1 + * @since v3001.0.5 + * @experimental This feature is in experimental phase, it will be fully released in v3001.1.0 */ has(compId: string | string[], op?: "and" | "or"): boolean; /** @@ -5636,7 +5641,8 @@ export interface GameObjRaw { * obj.tag(["enemy", "boss"]); * ``` * - * @since v3001.1 + * @since v3001.0.5 + * @experimental This feature is in experimental phase, it will be fully released in v3001.1.0 */ tag(tag: Tag | Tag[]): void; /** @@ -5653,7 +5659,8 @@ export interface GameObjRaw { * obj.untag(["enemy", "boss"]); * ``` * - * @since v3001.1 + * @since v3001.0.5 + * @experimental This feature is in experimental phase, it will be fully released in v3001.1.0 */ untag(tag: Tag | Tag[]): void; /** @@ -5662,18 +5669,10 @@ export interface GameObjRaw { * @param tag - The tag(s) for checking. * @param op - The operator to use when searching for multiple tags. Default is "and". * - * @since v3001.1 + * @since v3001.0.5 + * @experimental This feature is in experimental phase, it will be fully released in v3001.1.0 */ - is( - /** Tag(s) for checking */ - tag: Tag | Tag[], - /** - * Operator to use when searching for multiple tags. - * - * @default "and" - */ - op?: "and" | "or", - ): boolean; + is(tag: Tag | Tag[], op?: "and" | "or"): boolean; /** * Register an event. *