Skip to content

Commit

Permalink
doc: experimental tags in entries (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Dec 18, 2024
1 parent 956b159 commit a7ccb3a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
11 changes: 11 additions & 0 deletions .vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -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"
}
}
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,31 @@ 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
// cancel the event
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)

### Changed

- 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

Expand Down
31 changes: 15 additions & 16 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
/**
Expand All @@ -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;
/**
Expand All @@ -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;
/**
Expand All @@ -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.
*
Expand Down

0 comments on commit a7ccb3a

Please sign in to comment.