@solidexpert/ngx-joystick 0.0.0-stage → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Wesley Weitzel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,66 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # @solidexpert/ngx-joystick
2
+
3
+ NgxJoystick is an Angular joystick component. It is a wrapper around the [nipplejs](https://yoannmoi.net/nipplejs/) library providing joystick functionality to your Angular application.
4
+
5
+ Maintained by [solidexpert-ltd](https://github.com/solidexpert-ltd/ngx-joystick).
6
+
7
+ Upstream project: [https://github.com/wweitzel/ngx-joystick](https://github.com/wweitzel/ngx-joystick) (archived). Copyright remains with the original authors; see [LICENSE](LICENSE).
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @solidexpert/ngx-joystick
13
+ ```
14
+
15
+ Peer dependencies: `@angular/core` and `@angular/common` `^22.0.0`.
16
+
17
+ ## Example usage
18
+
19
+ Import `NgxJoystickModule` in your module:
20
+
21
+ ```typescript
22
+ import { NgxJoystickModule } from '@solidexpert/ngx-joystick';
23
+
24
+ @NgModule({
25
+ declarations: [
26
+ AppComponent
27
+ ],
28
+ imports: [
29
+ BrowserModule,
30
+ NgxJoystickModule
31
+ ],
32
+ providers: [],
33
+ bootstrap: [AppComponent]
34
+ })
35
+ export class AppModule { }
36
+ ```
37
+
38
+ ```html
39
+ <ngx-joystick
40
+ [options]="staticOptions"
41
+ (start)="onStart($event)"
42
+ (move)="onMove($event)"
43
+ (end)="onEnd($event)">
44
+ </ngx-joystick>
45
+ ```
46
+
47
+ ```typescript
48
+ import { JoystickEvent } from '@solidexpert/ngx-joystick';
49
+ import { JoystickManagerOptions } from 'nipplejs';
50
+
51
+ staticOptions: JoystickManagerOptions = {
52
+ mode: 'static',
53
+ position: { left: '50%', top: '50%' },
54
+ color: 'blue',
55
+ };
56
+
57
+ onMove(event: JoystickEvent) {
58
+ console.log(event.data);
59
+ }
60
+ ```
61
+
62
+ `options` is a nipplejs `JoystickManagerOptions` object. Outputs are `move`, `start`, `end`, `dir`, `dirUp`, `dirDown`, `dirLeft`, `dirRight`, `plain`, `plainUp`, `plainDown`, `plainLeft`, and `plainRight`. Each emits a `JoystickEvent` with nipplejs `event` and `data`.
63
+
64
+ ## License
65
+
66
+ MIT. Copyright (c) 2019 Wesley Weitzel.
@@ -0,0 +1,270 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, EventEmitter, Input, NgModule, Output, ViewChild } from "@angular/core";
3
+ import * as nipplejs from "nipplejs";
4
+ import { Subscription, fromEvent } from "rxjs";
5
+ var NgxJoystickComponent = class NgxJoystickComponent {
6
+ el;
7
+ joystickContainer;
8
+ options;
9
+ move = new EventEmitter();
10
+ start = new EventEmitter();
11
+ end = new EventEmitter();
12
+ dir = new EventEmitter();
13
+ dirUp = new EventEmitter();
14
+ dirDown = new EventEmitter();
15
+ dirLeft = new EventEmitter();
16
+ dirRight = new EventEmitter();
17
+ plain = new EventEmitter();
18
+ plainUp = new EventEmitter();
19
+ plainDown = new EventEmitter();
20
+ plainLeft = new EventEmitter();
21
+ plainRight = new EventEmitter();
22
+ manager;
23
+ interval;
24
+ touchMoveSubscription = new Subscription();
25
+ constructor(el) {
26
+ this.el = el;
27
+ }
28
+ ngOnInit() {
29
+ this.interval = window.setInterval(() => {
30
+ if (this.joystickContainer && this.joystickContainer.nativeElement.clientWidth && this.joystickContainer.nativeElement.clientHeight) {
31
+ if (!this.options) this.options = this.getDefaultOptions();
32
+ else this.options.zone = this.el.nativeElement;
33
+ this.manager = nipplejs.create(this.options);
34
+ this.setupEvents();
35
+ window.clearInterval(this.interval);
36
+ }
37
+ }, 100);
38
+ }
39
+ ngOnDestroy() {
40
+ window.clearInterval(this.interval);
41
+ if (this.manager) this.manager.destroy();
42
+ this.touchMoveSubscription.unsubscribe();
43
+ }
44
+ ngAfterViewInit() {
45
+ this.touchMoveSubscription = fromEvent(this.el.nativeElement, "touchmove").subscribe((event) => {
46
+ event.preventDefault();
47
+ event.stopPropagation();
48
+ });
49
+ }
50
+ getDefaultOptions() {
51
+ return {
52
+ zone: this.el.nativeElement,
53
+ mode: "static",
54
+ position: {
55
+ left: "50%",
56
+ top: "50%"
57
+ },
58
+ color: "blue"
59
+ };
60
+ }
61
+ emitEvent(event, emitter) {
62
+ const joystickEvent = {
63
+ event: event.event,
64
+ data: event.data
65
+ };
66
+ emitter.emit(joystickEvent);
67
+ }
68
+ setupEvents() {
69
+ this.manager.on("move", (event, data) => {
70
+ this.emitEvent({
71
+ event,
72
+ data
73
+ }, this.move);
74
+ });
75
+ this.manager.on("start", (event, data) => {
76
+ this.emitEvent({
77
+ event,
78
+ data
79
+ }, this.start);
80
+ });
81
+ this.manager.on("end", (event, data) => {
82
+ this.emitEvent({
83
+ event,
84
+ data
85
+ }, this.end);
86
+ });
87
+ this.manager.on("dir", (event, data) => {
88
+ this.emitEvent({
89
+ event,
90
+ data
91
+ }, this.dir);
92
+ });
93
+ this.manager.on("dir:up", (event, data) => {
94
+ this.emitEvent({
95
+ event,
96
+ data
97
+ }, this.dirUp);
98
+ });
99
+ this.manager.on("dir:down", (event, data) => {
100
+ this.emitEvent({
101
+ event,
102
+ data
103
+ }, this.dirDown);
104
+ });
105
+ this.manager.on("dir:left", (event, data) => {
106
+ this.emitEvent({
107
+ event,
108
+ data
109
+ }, this.dirLeft);
110
+ });
111
+ this.manager.on("dir:right", (event, data) => {
112
+ this.emitEvent({
113
+ event,
114
+ data
115
+ }, this.dirRight);
116
+ });
117
+ this.manager.on("plain", (event, data) => {
118
+ this.emitEvent({
119
+ event,
120
+ data
121
+ }, this.plain);
122
+ });
123
+ this.manager.on("plain:up", (event, data) => {
124
+ this.emitEvent({
125
+ event,
126
+ data
127
+ }, this.plainUp);
128
+ });
129
+ this.manager.on("plain:down", (event, data) => {
130
+ this.emitEvent({
131
+ event,
132
+ data
133
+ }, this.plainDown);
134
+ });
135
+ this.manager.on("plain:left", (event, data) => {
136
+ this.emitEvent({
137
+ event,
138
+ data
139
+ }, this.plainLeft);
140
+ });
141
+ this.manager.on("plain:right", (event, data) => {
142
+ this.emitEvent({
143
+ event,
144
+ data
145
+ }, this.plainRight);
146
+ });
147
+ }
148
+ static ɵfac = i0.ɵɵngDeclareFactory({
149
+ minVersion: "12.0.0",
150
+ version: "22.3.0",
151
+ ngImport: i0,
152
+ type: NgxJoystickComponent,
153
+ deps: [{ token: i0.ElementRef }],
154
+ target: i0.ɵɵFactoryTarget.Component
155
+ });
156
+ static ɵcmp = i0.ɵɵngDeclareComponent({
157
+ minVersion: "14.0.0",
158
+ version: "22.3.0",
159
+ type: NgxJoystickComponent,
160
+ isStandalone: false,
161
+ selector: "ngx-joystick",
162
+ inputs: { options: "options" },
163
+ outputs: {
164
+ move: "move",
165
+ start: "start",
166
+ end: "end",
167
+ dir: "dir",
168
+ dirUp: "dirUp",
169
+ dirDown: "dirDown",
170
+ dirLeft: "dirLeft",
171
+ dirRight: "dirRight",
172
+ plain: "plain",
173
+ plainUp: "plainUp",
174
+ plainDown: "plainDown",
175
+ plainLeft: "plainLeft",
176
+ plainRight: "plainRight"
177
+ },
178
+ viewQueries: [{
179
+ propertyName: "joystickContainer",
180
+ first: true,
181
+ predicate: ["joystickContainer"],
182
+ descendants: true
183
+ }],
184
+ ngImport: i0,
185
+ template: `
186
+ <div #joystickContainer style="width: 100%; height: 100%" id="static"></div>
187
+ `,
188
+ isInline: true,
189
+ changeDetection: i0.ChangeDetectionStrategy.Eager
190
+ });
191
+ };
192
+ i0.ɵɵngDeclareClassMetadata({
193
+ minVersion: "12.0.0",
194
+ version: "22.3.0",
195
+ ngImport: i0,
196
+ type: NgxJoystickComponent,
197
+ decorators: [{
198
+ type: Component,
199
+ args: [{
200
+ selector: "ngx-joystick",
201
+ template: `
202
+ <div #joystickContainer style="width: 100%; height: 100%" id="static"></div>
203
+ `,
204
+ changeDetection: ChangeDetectionStrategy.Eager,
205
+ standalone: false
206
+ }]
207
+ }],
208
+ ctorParameters: () => [{ type: i0.ElementRef }],
209
+ propDecorators: {
210
+ joystickContainer: [{
211
+ type: ViewChild,
212
+ args: ["joystickContainer"]
213
+ }],
214
+ options: [{ type: Input }],
215
+ move: [{ type: Output }],
216
+ start: [{ type: Output }],
217
+ end: [{ type: Output }],
218
+ dir: [{ type: Output }],
219
+ dirUp: [{ type: Output }],
220
+ dirDown: [{ type: Output }],
221
+ dirLeft: [{ type: Output }],
222
+ dirRight: [{ type: Output }],
223
+ plain: [{ type: Output }],
224
+ plainUp: [{ type: Output }],
225
+ plainDown: [{ type: Output }],
226
+ plainLeft: [{ type: Output }],
227
+ plainRight: [{ type: Output }]
228
+ }
229
+ });
230
+ var NgxJoystickModule = class NgxJoystickModule {
231
+ static ɵfac = i0.ɵɵngDeclareFactory({
232
+ minVersion: "12.0.0",
233
+ version: "22.3.0",
234
+ ngImport: i0,
235
+ type: NgxJoystickModule,
236
+ deps: [],
237
+ target: i0.ɵɵFactoryTarget.NgModule
238
+ });
239
+ static ɵmod = i0.ɵɵngDeclareNgModule({
240
+ minVersion: "14.0.0",
241
+ version: "22.3.0",
242
+ ngImport: i0,
243
+ type: NgxJoystickModule,
244
+ declarations: [NgxJoystickComponent],
245
+ exports: [NgxJoystickComponent]
246
+ });
247
+ static ɵinj = i0.ɵɵngDeclareInjector({
248
+ minVersion: "12.0.0",
249
+ version: "22.3.0",
250
+ ngImport: i0,
251
+ type: NgxJoystickModule
252
+ });
253
+ };
254
+ i0.ɵɵngDeclareClassMetadata({
255
+ minVersion: "12.0.0",
256
+ version: "22.3.0",
257
+ ngImport: i0,
258
+ type: NgxJoystickModule,
259
+ decorators: [{
260
+ type: NgModule,
261
+ args: [{
262
+ declarations: [NgxJoystickComponent],
263
+ imports: [],
264
+ exports: [NgxJoystickComponent]
265
+ }]
266
+ }]
267
+ });
268
+ export { NgxJoystickComponent, NgxJoystickModule };
269
+
270
+ //# sourceMappingURL=solidexpert-ngx-joystick.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solidexpert-ngx-joystick.mjs","names":[],"sources":["../../../projects/ngx-joystick/src/lib/ngx-joystick.component.ts","../../../projects/ngx-joystick/src/lib/ngx-joystick.module.ts"],"sourcesContent":["import { Component, OnInit, Output, EventEmitter, Input, ElementRef, OnDestroy, ViewChild, AfterViewInit, ChangeDetectionStrategy } from '@angular/core';\r\nimport * as nipplejs from 'nipplejs';\r\nimport { fromEvent, Subscription } from 'rxjs';\r\n\r\nexport interface JoystickEvent {\r\n event: nipplejs.EventData;\r\n data: nipplejs.JoystickOutputData;\r\n}\r\n\r\n@Component({\n selector: 'ngx-joystick',\n template: `\r\n <div #joystickContainer style=\"width: 100%; height: 100%\" id=\"static\"></div>\r\n `,\n styles: [],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: false\n})\r\nexport class NgxJoystickComponent implements OnInit, OnDestroy, AfterViewInit {\r\n @ViewChild('joystickContainer') joystickContainer!: ElementRef;\r\n\r\n @Input() options!: nipplejs.JoystickManagerOptions;\r\n\r\n @Output() move = new EventEmitter<JoystickEvent>();\r\n @Output() start = new EventEmitter<JoystickEvent>();\r\n @Output() end = new EventEmitter<JoystickEvent>();\r\n @Output() dir = new EventEmitter<JoystickEvent>();\r\n @Output() dirUp = new EventEmitter<JoystickEvent>();\r\n @Output() dirDown = new EventEmitter<JoystickEvent>();\r\n @Output() dirLeft = new EventEmitter<JoystickEvent>();\r\n @Output() dirRight = new EventEmitter<JoystickEvent>();\r\n @Output() plain = new EventEmitter<JoystickEvent>();\r\n @Output() plainUp = new EventEmitter<JoystickEvent>();\r\n @Output() plainDown = new EventEmitter<JoystickEvent>();\r\n @Output() plainLeft = new EventEmitter<JoystickEvent>();\r\n @Output() plainRight = new EventEmitter<JoystickEvent>();\r\n\r\n manager!: nipplejs.JoystickManager;\r\n\r\n private interval!: number;\r\n private touchMoveSubscription: Subscription = new Subscription();\r\n\r\n constructor(private el: ElementRef) {\r\n }\r\n\r\n ngOnInit() {\r\n this.interval = window.setInterval(() => {\r\n if (\r\n this.joystickContainer &&\r\n this.joystickContainer.nativeElement.clientWidth &&\r\n this.joystickContainer.nativeElement.clientHeight\r\n ) {\r\n if (!this.options) {\r\n this.options = this.getDefaultOptions();\r\n } else {\r\n this.options.zone = this.el.nativeElement;\r\n }\r\n this.manager = nipplejs.create(this.options);\r\n this.setupEvents();\r\n\r\n window.clearInterval(this.interval);\r\n }\r\n }, 100);\r\n }\r\n\r\n ngOnDestroy() {\r\n window.clearInterval(this.interval);\r\n if (this.manager) {\r\n this.manager.destroy();\r\n }\r\n this.touchMoveSubscription.unsubscribe();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.touchMoveSubscription = fromEvent(this.el.nativeElement, 'touchmove').subscribe((event: any) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n });\r\n }\r\n\r\n private getDefaultOptions(): nipplejs.JoystickManagerOptions {\r\n const options: nipplejs.JoystickManagerOptions = {\r\n zone: this.el.nativeElement,\r\n mode: 'static',\r\n position: { left: '50%', top: '50%' },\r\n color: 'blue'\r\n };\r\n return options;\r\n }\r\n\r\n private emitEvent(event: any, emitter: EventEmitter<any>) {\r\n const joystickEvent: JoystickEvent = { event: event.event, data: event.data };\r\n emitter.emit(joystickEvent);\r\n }\r\n\r\n private setupEvents() {\r\n this.manager.on('move', (event, data) => { this.emitEvent({event, data}, this.move); });\r\n this.manager.on('start', (event, data) => { this.emitEvent({event, data}, this.start); });\r\n this.manager.on('end', (event, data) => { this.emitEvent({event, data}, this.end); });\r\n this.manager.on('dir', (event, data) => { this.emitEvent({event, data}, this.dir); });\r\n this.manager.on('dir:up', (event, data) => { this.emitEvent({event, data}, this.dirUp); });\r\n this.manager.on('dir:down', (event, data) => { this.emitEvent({event, data}, this.dirDown); });\r\n this.manager.on('dir:left', (event, data) => { this.emitEvent({event, data}, this.dirLeft); });\r\n this.manager.on('dir:right', (event, data) => { this.emitEvent({event, data}, this.dirRight); });\r\n this.manager.on('plain', (event, data) => { this.emitEvent({event, data}, this.plain); });\r\n this.manager.on('plain:up', (event, data) => { this.emitEvent({event, data}, this.plainUp); });\r\n this.manager.on('plain:down', (event, data) => { this.emitEvent({event, data}, this.plainDown); });\r\n this.manager.on('plain:left', (event, data) => { this.emitEvent({event, data}, this.plainLeft); });\r\n this.manager.on('plain:right', (event, data) => { this.emitEvent({event, data}, this.plainRight); });\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NgxJoystickComponent } from './ngx-joystick.component';\r\n\r\n@NgModule({\r\n declarations: [NgxJoystickComponent],\r\n imports: [\r\n ],\r\n exports: [NgxJoystickComponent]\r\n})\r\nexport class NgxJoystickModule { }\r\n"],"mappings":";;;;AAkBA,IAAa,uB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,QACA,MAAA,O;E,UACA,MAAA,O;E,YACA,MAAA,O;E,YACA,MAAA,O;E,aACA,MAAA,O;E,UACA,MAAA,O;E,YACA,MAAA,O;E,cACA,MAAA,O;E,cACA,MAAA,O;E,eACA,MAAA,O;;;AC1BH,IAAa,oBAAb,MAAa,kBAAiB;CAAjB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAiB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAjB,OAAA,OAAA,GAAA,oBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAiB,cAAA,CALb,oBAAoB;EAAA,SAAA,CAGzB,oBAAoB;CAAA,CAAA;CAEnB,OAAA,OAAA,GAAA,oBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;CAAiB,CAAA;;AAAjB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EAN7B,MAAA;EAAS,MAAA,CAAA;GACR,cAAc,CAAC,oBAAoB;GACnC,SAAS,CAAA;GAET,SAAS,CAAC,oBAAoB;EAC/B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,47 @@
1
1
  {
2
2
  "name": "@solidexpert/ngx-joystick",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "22.0.0",
4
+ "description": "NgxJoystick is an angular joystick component. It is a wrapper around the nipplejs library providing virtual joystick functionality to your angular application.",
5
+ "author": "Wes Weitzel",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/solidexpert-ltd/ngx-joystick.git"
9
+ },
10
+ "homepage": "https://github.com/solidexpert-ltd/ngx-joystick",
11
+ "bugs": {
12
+ "url": "https://github.com/solidexpert-ltd/ngx-joystick/issues"
13
+ },
14
+ "keywords": [
15
+ "angular",
16
+ "javascript",
17
+ "typescript",
18
+ "component",
19
+ "joystick",
20
+ "nipplejs"
21
+ ],
22
+ "license": "MIT",
23
+ "engines": {
24
+ "node": "^22.22.3 || ^24.15.0 || >=26"
25
+ },
26
+ "dependencies": {
27
+ "nipplejs": "^0.10.1",
28
+ "tslib": "^2.3.1"
29
+ },
30
+ "peerDependencies": {
31
+ "@angular/common": "^22.0.0",
32
+ "@angular/core": "^22.0.0"
33
+ },
34
+ "module": "fesm2022/solidexpert-ngx-joystick.mjs",
35
+ "typings": "types/solidexpert-ngx-joystick.d.ts",
36
+ "exports": {
37
+ "./package.json": {
38
+ "default": "./package.json"
39
+ },
40
+ ".": {
41
+ "types": "./types/solidexpert-ngx-joystick.d.ts",
42
+ "default": "./fesm2022/solidexpert-ngx-joystick.mjs"
43
+ }
44
+ },
45
+ "sideEffects": false,
46
+ "type": "module"
6
47
  }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import * as i0 from "@angular/core";
5
+ import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit } from "@angular/core";
6
+ import * as nipplejs from "nipplejs";
7
+ export interface JoystickEvent {
8
+ event: nipplejs.EventData;
9
+ data: nipplejs.JoystickOutputData;
10
+ }
11
+ export declare class NgxJoystickComponent implements OnInit, OnDestroy, AfterViewInit {
12
+ private el;
13
+ joystickContainer: ElementRef;
14
+ options: nipplejs.JoystickManagerOptions;
15
+ move: EventEmitter<JoystickEvent>;
16
+ start: EventEmitter<JoystickEvent>;
17
+ end: EventEmitter<JoystickEvent>;
18
+ dir: EventEmitter<JoystickEvent>;
19
+ dirUp: EventEmitter<JoystickEvent>;
20
+ dirDown: EventEmitter<JoystickEvent>;
21
+ dirLeft: EventEmitter<JoystickEvent>;
22
+ dirRight: EventEmitter<JoystickEvent>;
23
+ plain: EventEmitter<JoystickEvent>;
24
+ plainUp: EventEmitter<JoystickEvent>;
25
+ plainDown: EventEmitter<JoystickEvent>;
26
+ plainLeft: EventEmitter<JoystickEvent>;
27
+ plainRight: EventEmitter<JoystickEvent>;
28
+ manager: nipplejs.JoystickManager;
29
+ private interval;
30
+ private touchMoveSubscription;
31
+ constructor(el: ElementRef);
32
+ ngOnInit(): void;
33
+ ngOnDestroy(): void;
34
+ ngAfterViewInit(): void;
35
+ private getDefaultOptions;
36
+ private emitEvent;
37
+ private setupEvents;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxJoystickComponent, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxJoystickComponent, "ngx-joystick", never, {
40
+ "options": {
41
+ "alias": "options";
42
+ "required": false;
43
+ };
44
+ }, {
45
+ "move": "move";
46
+ "start": "start";
47
+ "end": "end";
48
+ "dir": "dir";
49
+ "dirUp": "dirUp";
50
+ "dirDown": "dirDown";
51
+ "dirLeft": "dirLeft";
52
+ "dirRight": "dirRight";
53
+ "plain": "plain";
54
+ "plainUp": "plainUp";
55
+ "plainDown": "plainDown";
56
+ "plainLeft": "plainLeft";
57
+ "plainRight": "plainRight";
58
+ }, never, never, false, never>;
59
+ }
60
+ export declare class NgxJoystickModule {
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxJoystickModule, never>;
62
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxJoystickModule, [typeof NgxJoystickComponent], never, [typeof NgxJoystickComponent]>;
63
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxJoystickModule>;
64
+ }