mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Narrow linting rules and fix for eslintrc for js files
This commit is contained in:
@@ -489,8 +489,7 @@ function packageLinuxRpm(
|
||||
function packageWin32(
|
||||
arch,
|
||||
platformExecutableName,
|
||||
platformExecutablePath,
|
||||
platformManifestPath
|
||||
platformExecutablePath
|
||||
) {
|
||||
const outputName = `${meta.__applicationName}-${meta.__applicationVersion}-${arch}.exe`;
|
||||
|
||||
@@ -525,6 +524,6 @@ function packageWin32(
|
||||
}
|
||||
|
||||
build().catch(e => {
|
||||
console.log("Build failed", e);
|
||||
console.error("Build failed", e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
1
app/package-lock.json
generated
1
app/package-lock.json
generated
@@ -13,7 +13,6 @@
|
||||
"mime-types": "^2.1.35",
|
||||
"minimist": "^1.2.6",
|
||||
"node-fetch": "^3.2.3",
|
||||
"rage-edit": "*",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ws": "^8.5.0"
|
||||
},
|
||||
|
||||
@@ -72,8 +72,6 @@ export default class Session extends CastClient {
|
||||
this.establishAppConnection(this.transportId);
|
||||
this.onSessionCreated?.(this.sessionId);
|
||||
|
||||
const { friendlyName } = this.receiverDevice;
|
||||
|
||||
messaging.sendMessage({
|
||||
subject: "cast:sessionCreated",
|
||||
data: {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import messaging, { Message } from "../../messaging";
|
||||
|
||||
import Session from "./Session";
|
||||
import CastClient, { NS_CONNECTION, NS_RECEIVER } from "./client";
|
||||
import CastClient from "./client";
|
||||
|
||||
const sessions = new Map<string, Session>();
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ interface BreakClip {
|
||||
contentId?: string;
|
||||
contentType?: string;
|
||||
contentUrl?: string;
|
||||
customData?: {};
|
||||
customData?: unknown;
|
||||
duration?: number;
|
||||
id: string;
|
||||
hlsSegmentFormat?: HlsSegmentFormat;
|
||||
@@ -137,7 +137,7 @@ interface BreakClip {
|
||||
|
||||
interface TextTrackStyle {
|
||||
backgroundColor: Nullable<string>;
|
||||
customData: any;
|
||||
customData: unknown;
|
||||
edgeColor: Nullable<string>;
|
||||
edgeType: Nullable<string>;
|
||||
fontFamily: Nullable<string>;
|
||||
@@ -151,7 +151,7 @@ interface TextTrackStyle {
|
||||
}
|
||||
|
||||
interface Track {
|
||||
customData: any;
|
||||
customData: unknown;
|
||||
language: Nullable<string>;
|
||||
name: Nullable<string>;
|
||||
subtype: Nullable<string>;
|
||||
@@ -162,7 +162,7 @@ interface Track {
|
||||
}
|
||||
|
||||
interface UserActionState {
|
||||
customData: any;
|
||||
customData: unknown;
|
||||
userAction: UserAction;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ interface MediaInformation {
|
||||
contentId: string;
|
||||
contentType: string;
|
||||
contentUrl?: string;
|
||||
customData: any;
|
||||
customData: unknown;
|
||||
duration: Nullable<number>;
|
||||
entity?: string;
|
||||
hlsSegmentFormat?: HlsSegmentFormat;
|
||||
@@ -269,7 +269,7 @@ interface PhotoMediaMetadata {
|
||||
interface QueueItem {
|
||||
activeTrackIds: Nullable<number[]>;
|
||||
autoplay: boolean;
|
||||
customData: any;
|
||||
customData: unknown;
|
||||
itemId: Nullable<number>;
|
||||
media: MediaInformation;
|
||||
playbackDuration: Nullable<number>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { handleCastMessage } from "./components/cast";
|
||||
import { startDiscovery, stopDiscovery } from "./components/discovery";
|
||||
import { startMediaServer, stopMediaServer } from "./components/mediaServer";
|
||||
|
||||
import { __applicationName, __applicationVersion } from "../../package.json";
|
||||
import { __applicationVersion } from "../../package.json";
|
||||
|
||||
process.on("SIGTERM", () => {
|
||||
stopDiscovery();
|
||||
|
||||
@@ -37,7 +37,6 @@ export async function convertSrtToVtt(srtFilePath: string) {
|
||||
* millisecond separator.
|
||||
*/
|
||||
for (const groups of fileContents.matchAll(REGEX_CAPTION)) {
|
||||
const captionSource = groups[0];
|
||||
const captionIndex = groups[1];
|
||||
const captionTime = groups[2];
|
||||
const captionText = groups[3];
|
||||
|
||||
@@ -163,12 +163,12 @@ type MessageDefinitions = {
|
||||
/**
|
||||
* Sent to bridge to stop HTTP media server.
|
||||
*/
|
||||
"bridge:stopMediaServer": {};
|
||||
"bridge:stopMediaServer": undefined;
|
||||
/**
|
||||
* Sent to media sender from bridge when the media server has
|
||||
* stopped.
|
||||
*/
|
||||
"mediaCast:mediaServerStopped": {};
|
||||
"mediaCast:mediaServerStopped": undefined;
|
||||
/**
|
||||
* Sent to media sender from bridge when the media server has
|
||||
* encountered an error.
|
||||
@@ -190,8 +190,8 @@ type Messages = {
|
||||
* all-optional keys.
|
||||
*/
|
||||
type NarrowedMessage<L extends MessageBase<keyof MessageDefinitions>> =
|
||||
L extends any
|
||||
? {} extends L["data"]
|
||||
L extends unknown
|
||||
? undefined extends L["data"]
|
||||
? Omit<L, "data"> & Partial<L>
|
||||
: L
|
||||
: never;
|
||||
@@ -231,7 +231,7 @@ class Messenger extends TypedEmitter<MessengerEvents> {
|
||||
this.encodeTransform.write(message);
|
||||
}
|
||||
|
||||
send(data: any) {
|
||||
send(data: unknown) {
|
||||
this.encodeTransform.write(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
import { Transform } from "stream";
|
||||
import { Transform, TransformCallback } from "stream";
|
||||
import { Message } from "./bridge/messaging";
|
||||
|
||||
type ResponseHandlerFunction = (message: Message) => Promise<any>;
|
||||
type ResponseHandlerFunction = (message: Message) => Promise<unknown>;
|
||||
|
||||
/**
|
||||
* Takes a handler function that implements the transform
|
||||
@@ -20,8 +20,7 @@ export class ResponseTransform extends Transform {
|
||||
public _transform(
|
||||
chunk: Message,
|
||||
_encoding: string,
|
||||
// tslint:disable-next-line:ban-types
|
||||
callback: Function
|
||||
callback: TransformCallback
|
||||
) {
|
||||
Promise.resolve(this._handler(chunk)).then(res => {
|
||||
if (res) {
|
||||
@@ -49,10 +48,10 @@ export class DecodeTransform extends Transform {
|
||||
}
|
||||
|
||||
public _transform(
|
||||
chunk: any,
|
||||
chunk: Uint8Array,
|
||||
_encoding: string,
|
||||
// tslint:disable-next-line:ban-types
|
||||
callback: Function
|
||||
callback: TransformCallback
|
||||
) {
|
||||
// Append next chunk to buffer
|
||||
this._messageBuffer = Buffer.concat([this._messageBuffer, chunk]);
|
||||
@@ -108,10 +107,10 @@ export class EncodeTransform extends Transform {
|
||||
}
|
||||
|
||||
public _transform(
|
||||
chunk: any,
|
||||
chunk: Uint8Array,
|
||||
_encoding: string,
|
||||
// tslint:disable-next-line:ban-types
|
||||
callback: Function
|
||||
callback: TransformCallback
|
||||
) {
|
||||
const messageLength = Buffer.alloc(4);
|
||||
const message = Buffer.from(JSON.stringify(chunk));
|
||||
|
||||
Reference in New Issue
Block a user