Skip to content

Commit 723ea35

Browse files
authored
ThreadX removed (#347)
2 parents 0757e1d + d6ec812 commit 723ea35

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"vitest-mock-extended": "^1.3.1"
6565
},
6666
"dependencies": {
67-
"@lightningjs/threadx": "^0.3.5",
6867
"@protobufjs/eventemitter": "^1.1.0",
6968
"memize": "^2.1.0"
7069
},

pnpm-lock.yaml

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/common/EventEmitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
2222
/* eslint-disable @typescript-eslint/no-unsafe-call */
2323
/* eslint-disable @typescript-eslint/no-explicit-any */
24-
import type { IEventEmitter } from '@lightningjs/threadx';
24+
import type { IEventEmitter } from './IEventEmitter.js';
2525

2626
/**
2727
* EventEmitter base class

src/common/IAnimationController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19-
import type { IEventEmitter } from '@lightningjs/threadx';
19+
import type { IEventEmitter } from './IEventEmitter.js';
2020

2121
export type AnimationControllerState = 'running' | 'paused' | 'stopped';
2222

src/common/IEventEmitter.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2023 Comcast Cable Communications Management, LLC
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*
15+
* SPDX-License-Identifier: Apache-2.0
16+
*/
17+
18+
export interface IEventEmitter<
19+
T extends object = { [s: string]: (target: any, data: any) => void },
20+
> {
21+
on<K extends keyof T>(event: Extract<K, string>, listener: T[K]): void;
22+
once<K extends keyof T>(event: Extract<K, string>, listener: T[K]): void;
23+
off<K extends keyof T>(event: Extract<K, string>, listener: T[K]): void;
24+
emit<K extends keyof T>(
25+
event: Extract<K, string>,
26+
data: Parameters<any>[1],
27+
): void;
28+
}

0 commit comments

Comments
 (0)