{"id":17365649,"url":"https://github.com/wonderlandengine/api","last_synced_at":"2025-04-13T21:32:40.582Z","repository":{"id":65758331,"uuid":"367643208","full_name":"WonderlandEngine/api","owner":"WonderlandEngine","description":"Wonderland Engine's JavaScript API.","archived":false,"fork":false,"pushed_at":"2024-10-14T15:59:56.000Z","size":972,"stargazers_count":10,"open_issues_count":7,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T19:02:04.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WonderlandEngine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-15T13:48:35.000Z","updated_at":"2025-01-21T05:02:08.000Z","dependencies_parsed_at":"2024-05-06T11:57:01.991Z","dependency_job_id":"2ced5df5-4888-4027-b377-4a5ce295303f","html_url":"https://github.com/WonderlandEngine/api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WonderlandEngine%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WonderlandEngine%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WonderlandEngine%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WonderlandEngine%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WonderlandEngine","download_url":"https://codeload.github.com/WonderlandEngine/api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248787211,"owners_count":21161566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T21:05:34.704Z","updated_at":"2025-04-13T21:32:40.551Z","avatar_url":"https://github.com/WonderlandEngine.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/WonderlandEngine/api/blob/master/img/wle-logo-horizontal-reversed-dark.png?raw=true\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/WonderlandEngine/api/blob/master/img/wle-logo-horizontal-reversed-light.png?raw=true\"\u003e\n  \u003csource srcset=\"https://github.com/WonderlandEngine/api/blob/master/img/wle-logo-horizontal-reversed-light.png?raw=true\"\u003e\n  \u003cimg alt=\"Wonderland Engine Logo\" src=\"https://github.com/WonderlandEngine/api/blob/master/img/wle-logo-horizontal-reversed-light.png?raw=true\"\u003e\n\u003c/picture\u003e\n\n# Wonderland Engine API\n\nThe bindings between Wonderland Engine's WebAssembly runtime and custom JavaScript\nor TypeScript components.\n\nLearn more about Wonderland Engine at [https://wonderlandengine.com](https://wonderlandengine.com).\n\n\u003e 💡 The Wonderland Engine Runtime is compatible on all patch versions of the API, but the\n\u003e major and minor versions are required to match.\n\u003e\n\u003e **Example:** You will be able to use Wonderland Editor 1.0.4 with API\n\u003e version 1.0.0 or 1.0.9 for example, but not with API 1.1.0. 💡\n\n## Usage\n\nWonderland Engine projects usually come with this package pre-installed.\nInstall via `npm` or `yarn`:\n\n```sh\nnpm i --save @wonderlandengine/api\n# or:\nyarn add @wonderlandengine/api\n```\n\nTo update the API to the latest version use\n```\nnpm i --save @wonderlandengine/api@latest\n```\n\n### Writing a Custom Component\n\n**JavaScript**\n\n```js\nimport {Component, Property} from '@wonderlandengine/api';\n\nclass Forward extends Component {\n    static TypeName = 'forward';\n    static Properties = {\n        speed: Property.float(1.5)\n    };\n\n    _forward = new Float32Array(3);\n\n    update(dt) {\n        this.object.getForward(this._forward);\n        this._forward[0] *= this.speed*dt;\n        this._forward[1] *= this.speed*dt;\n        this._forward[2] *= this.speed*dt;\n        this.object.translateLocal(this._forward);\n    }\n}\n```\n\n**TypeScript**\n\n```ts\nimport {Component} from '@wonderlandengine/api';\nimport {Component} from '@wonderlandengine/api/decorators.js';\n\nclass Forward extends Component {\n    static TypeName = 'forward';\n\n    @property.float(1.5)\n    speed!: number;\n\n    private _forward = new Float32Array(3);\n\n    update(dt) {\n        this.object.getForward(this._forward);\n        this._forward[0] *= this.speed*dt;\n        this._forward[1] *= this.speed*dt;\n        this._forward[2] *= this.speed*dt;\n        this.object.translateLocal(this._forward);\n    }\n}\n```\n\nFor more information, please refer to the [JavaScript Quick Start Guide](https://wonderlandengine.com/getting-started/quick-start-js).\n\n### For Library Maintainers\n\nTo ensure the user of your library can use a range of API versions with your library,\nuse `\"peerDependencies\"` in your `package.json`:\n\n```json\n\"peerDependencies\": {\n    \"@wonderlandengine/api\": \"\u003e= 1.0.0 \u003c 2\"\n},\n```\n\nWhich signals that your package works with any API version `\u003e= 1.0.0`\n(choose the lowest version that provides all features you need) until `2.0.0`.\n\nAlso see the [Writing JavaScript Libraries Tutorial](https://wonderlandengine.com/tutorials/writing-js-library/).\n\n## Contributing\n\n* [API code](./packages/api): The `@wonderlandengine/api` source code\n* [End2End tests](./packages/test-e2e): User-land testing for the `@wonderlandengine/api` package\n\n### Installation\n\nMake sure to install dependencies first:\n\n```sh\nnpm i\n```\n\n### Build\n\nTo build the TypeScript code, use one of:\n\n```sh\ncd api\nnpm run build\nnpm run build:watch\n```\n\n### End-to-End Test\n\nFor information about how to run the end-to-end tests, have a look at the\n`packages/test-e2e` [README.md](./test/README.md)\n\n## License\n\nWonderland Engine API TypeScript and JavaScript code is released under MIT license.\nThe runtime and editor are licensed under the [Wonderland Engine EULA](https://wonderlandengine.com/eula).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwonderlandengine%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwonderlandengine%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwonderlandengine%2Fapi/lists"}