Skip to content

Commit

Permalink
biome 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Nov 28, 2023
1 parent a456796 commit 75d6035
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 79 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.3.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
"organizeImports": {
"enabled": true
},
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@
"knip": "knip",
"prepare": "husky install"
},
"devDependencies": {
"@biomejs/biome": "1.3.3",
"@types/node": "20.10.0",
"@types/react": "18.2.38",
"@types/react-redux": "7.1.31",
"@types/redux-logger": "3.0.12",
"@vitejs/plugin-react": "4.2.0",
"husky": "8.0.3",
"jsdom": "23.0.0",
"knip": "2.43.0",
"next": "14.0.3",
"rimraf": "5.0.5",
"typescript": "5.3.2",
"vitest": "0.34.6"
},
"dependencies": {
"@reduxjs/toolkit": "1.9.7",
"@shiguredo/light-adjustment": "2023.2.0",
Expand All @@ -57,6 +42,21 @@
"redux-thunk": "2.4.2",
"sora-js-sdk": "2023.2.0-canary.7"
},
"devDependencies": {
"@biomejs/biome": "1.4.0",
"@types/node": "20.10.0",
"@types/react": "18.2.38",
"@types/react-redux": "7.1.31",
"@types/redux-logger": "3.0.12",
"@vitejs/plugin-react": "4.2.0",
"husky": "8.0.3",
"jsdom": "23.0.0",
"knip": "2.43.0",
"next": "14.0.3",
"rimraf": "5.0.5",
"typescript": "5.3.2",
"vitest": "0.34.6"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.17.1"
Expand Down
44 changes: 22 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 31 additions & 31 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ import {
export type SoraDevtoolsState = {
alertMessages: AlertMessage[]
audio: boolean
audioBitRate: typeof AUDIO_BIT_RATES[number]
audioCodecType: typeof AUDIO_CODEC_TYPES[number]
audioContentHint: typeof AUDIO_CONTENT_HINTS[number]
audioBitRate: (typeof AUDIO_BIT_RATES)[number]
audioCodecType: (typeof AUDIO_CODEC_TYPES)[number]
audioContentHint: (typeof AUDIO_CONTENT_HINTS)[number]
audioInput: string
audioInputDevices: MediaDeviceInfo[]
audioOutput: string
audioOutputDevices: MediaDeviceInfo[]
autoGainControl: typeof AUTO_GAIN_CONTROLS[number]
blurRadius: typeof BLUR_RADIUS[number]
autoGainControl: (typeof AUTO_GAIN_CONTROLS)[number]
blurRadius: (typeof BLUR_RADIUS)[number]
bundleId: string
channelId: string
clientId: string
Expand All @@ -63,12 +63,12 @@ export type SoraDevtoolsState = {
debug: boolean
debugFilterText: string
debugType: DebugType
dataChannelSignaling: typeof DATA_CHANNEL_SIGNALING[number]
dataChannelSignaling: (typeof DATA_CHANNEL_SIGNALING)[number]
dataChannels: string
dataChannelMessages: DataChannelMessage[]
displayResolution: typeof DISPLAY_RESOLUTIONS[number]
echoCancellation: typeof ECHO_CANCELLATIONS[number]
echoCancellationType: typeof ECHO_CANCELLATION_TYPES[number]
displayResolution: (typeof DISPLAY_RESOLUTIONS)[number]
echoCancellation: (typeof ECHO_CANCELLATIONS)[number]
echoCancellationType: (typeof ECHO_CANCELLATION_TYPES)[number]
e2ee: boolean
enabledBundleId: boolean
enabledClientId: boolean
Expand All @@ -83,16 +83,16 @@ export type SoraDevtoolsState = {
enabledVideoAV1Params: boolean
audioStreamingLanguageCode: string
enabledAudioStreamingLanguageCode: boolean
audioLyraParamsBitrate: typeof AUDIO_LYRA_PARAMS_BITRATES[number]
audioLyraParamsBitrate: (typeof AUDIO_LYRA_PARAMS_BITRATES)[number]
fakeContents: {
worker: Worker | null
colorCode: number
gainNode: GainNode | null
}
fakeVolume: string
frameRate: typeof FRAME_RATES[number]
frameRate: (typeof FRAME_RATES)[number]
soraContents: {
connectionStatus: typeof CONNECTION_STATUS[number]
connectionStatus: (typeof CONNECTION_STATUS)[number]
reconnecting: boolean
reconnectingTrials: number
sora: ConnectionPublisher | ConnectionSubscriber | null
Expand All @@ -104,35 +104,35 @@ export type SoraDevtoolsState = {
statsReport: RTCStats[]
datachannels: DataChannelConfiguration[]
}
ignoreDisconnectWebSocket: typeof IGNORE_DISCONNECT_WEBSOCKET[number]
ignoreDisconnectWebSocket: (typeof IGNORE_DISCONNECT_WEBSOCKET)[number]
logMessages: LogMessage[]
mediaProcessorsNoiseSuppression: boolean
mediaType: typeof MEDIA_TYPES[number]
mediaType: (typeof MEDIA_TYPES)[number]
metadata: string
multistream: typeof MULTISTREAM[number]
multistream: (typeof MULTISTREAM)[number]
mute: boolean
noiseSuppression: typeof NOISE_SUPPRESSIONS[number]
noiseSuppression: (typeof NOISE_SUPPRESSIONS)[number]
notifyMessages: NotifyMessage[]
pushMessages: PushMessage[]
resolution: typeof RESOLUTIONS[number]
resolution: (typeof RESOLUTIONS)[number]
showStats: boolean
signalingMessages: SignalingMessage[]
signalingNotifyMetadata: string
signalingUrlCandidates: string[]
forwardingFilter: string
simulcast: typeof SIMULCAST[number]
simulcastRid: typeof SIMULCAST_RID[number]
spotlight: typeof SPOTLIGHT[number]
simulcast: (typeof SIMULCAST)[number]
simulcastRid: (typeof SIMULCAST_RID)[number]
spotlight: (typeof SPOTLIGHT)[number]
focusedSpotlightConnectionIds: {
[key: string]: boolean
}
spotlightNumber: typeof SPOTLIGHT_NUMBERS[number]
spotlightFocusRid: typeof SPOTLIGHT_FOCUS_RIDS[number]
spotlightUnfocusRid: typeof SPOTLIGHT_FOCUS_RIDS[number]
spotlightNumber: (typeof SPOTLIGHT_NUMBERS)[number]
spotlightFocusRid: (typeof SPOTLIGHT_FOCUS_RIDS)[number]
spotlightUnfocusRid: (typeof SPOTLIGHT_FOCUS_RIDS)[number]
video: boolean
videoBitRate: typeof VIDEO_BIT_RATES[number]
videoCodecType: typeof VIDEO_CODEC_TYPES[number]
videoContentHint: typeof VIDEO_CONTENT_HINTS[number]
videoBitRate: (typeof VIDEO_BIT_RATES)[number]
videoCodecType: (typeof VIDEO_CODEC_TYPES)[number]
videoContentHint: (typeof VIDEO_CONTENT_HINTS)[number]
videoInput: string
videoInputDevices: MediaDeviceInfo[]
videoVP9Params: string
Expand All @@ -146,13 +146,13 @@ export type SoraDevtoolsState = {
role: Role
reconnect: boolean
apiUrl: null | string
aspectRatio: typeof ASPECT_RATIO_TYPES[number]
resizeMode: typeof RESIZE_MODE_TYPES[number]
lightAdjustment: typeof LIGHT_ADJUSTMENT[number]
aspectRatio: (typeof ASPECT_RATIO_TYPES)[number]
resizeMode: (typeof RESIZE_MODE_TYPES)[number]
lightAdjustment: (typeof LIGHT_ADJUSTMENT)[number]
lightAdjustmentProcessor: LightAdjustmentProcessor | null
noiseSuppressionProcessor: NoiseSuppressionProcessor | null
virtualBackgroundProcessor: VirtualBackgroundProcessor | null
facingMode: typeof FACING_MODES[number]
facingMode: (typeof FACING_MODES)[number]
}

// 画面表示する message の Type
Expand Down Expand Up @@ -307,7 +307,7 @@ export type DataChannelMessage = {
}

// Debug 表示タブ選択状態用の Type
export type DebugType = typeof DEBUG_TYPES[number]
export type DebugType = (typeof DEBUG_TYPES)[number]

// クエリ文字列から取得する parameter の Type
export type QueryStringParameters = Omit<
Expand Down
21 changes: 11 additions & 10 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function copy2clipboard(text: string): Promise<void> {
export function checkFormValue<T extends readonly string[]>(
value: unknown,
candidates: T,
): value is typeof candidates[number] {
): value is (typeof candidates)[number] {
if (typeof value === 'string') {
return candidates.indexOf(value) >= 0
}
Expand Down Expand Up @@ -102,7 +102,7 @@ export function parseQueryString(): Partial<QueryStringParameters> {
const parseSpecifiedStringParameter = <T extends readonly string[]>(
parameter: string | (string | null)[] | null,
candidates: T,
): typeof candidates[number] | undefined => {
): (typeof candidates)[number] | undefined => {
if (checkFormValue(parameter, candidates)) {
return parameter
}
Expand Down Expand Up @@ -263,7 +263,7 @@ export function getValueByAspectRatio(aspectRatio: string): number {
}

// devtools の blurRadius 文字列に対する数値を返す
export function getBlurRadiusNumber(blurRadius: typeof BLUR_RADIUS[number]): number {
export function getBlurRadiusNumber(blurRadius: (typeof BLUR_RADIUS)[number]): number {
switch (blurRadius) {
case 'weak':
return 5
Expand All @@ -278,7 +278,7 @@ export function getBlurRadiusNumber(blurRadius: typeof BLUR_RADIUS[number]): num

// devtools の lightAdjustment 文字列に対するオプションを返す
export function getLightAdjustmentOptions(
lightAdjustment: typeof LIGHT_ADJUSTMENT[number],
lightAdjustment: (typeof LIGHT_ADJUSTMENT)[number],
): LightAdjustmentProcessorOptions {
switch (lightAdjustment) {
case 'weak':
Expand All @@ -301,10 +301,10 @@ export function getLightAdjustmentOptions(
// getUserMedia の audio constraints を生成
type CreateAudioConstraintsParameters = {
audio: boolean
autoGainControl: typeof AUTO_GAIN_CONTROLS[number]
noiseSuppression: typeof NOISE_SUPPRESSIONS[number]
echoCancellation: typeof ECHO_CANCELLATIONS[number]
echoCancellationType: typeof ECHO_CANCELLATION_TYPES[number]
autoGainControl: (typeof AUTO_GAIN_CONTROLS)[number]
noiseSuppression: (typeof NOISE_SUPPRESSIONS)[number]
echoCancellation: (typeof ECHO_CANCELLATIONS)[number]
echoCancellationType: (typeof ECHO_CANCELLATION_TYPES)[number]
audioInput: string
}
export function createAudioConstraints(
Expand Down Expand Up @@ -558,7 +558,8 @@ export function drawFakeCanvas(
export function parseBooleanString(value: string): boolean | undefined {
if (value === 'true') {
return true
} else if (value === 'false') {
}
if (value === 'false') {
return false
}
return
Expand All @@ -576,7 +577,7 @@ export function parseMetadata(enabledMetadata: boolean, metadata: string): Json
return metadata
}

export function getDefaultVideoCodecType(): typeof VIDEO_CODEC_TYPES[number] {
export function getDefaultVideoCodecType(): (typeof VIDEO_CODEC_TYPES)[number] {
// getCapabilities API が存在しない場合
if (!window.RTCRtpSender || !RTCRtpSender.getCapabilities) {
return 'VP9'
Expand Down

0 comments on commit 75d6035

Please sign in to comment.