Skip to content

Commit

Permalink
Merge pull request #301 from tv2/chore/renaming-of-interfaces-removing-i
Browse files Browse the repository at this point in the history
chore: all interfaces renamed so i infront of name is removed.
  • Loading branch information
olzzon committed Jan 30, 2024
2 parents ed03e44 + 3260bba commit 4747f35
Show file tree
Hide file tree
Showing 70 changed files with 530 additions and 536 deletions.
4 changes: 2 additions & 2 deletions client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import {

import { I18nextProvider } from 'react-i18next'
import i18n from './src/utils/i18n'
import { IMixerProtocol } from '../shared/src/constants/MixerProtocolInterface'
import { MixerProtocol } from '../shared/src/constants/MixerProtocolInterface'

declare global {
interface Window {
storeRedux: any
reduxState: any
mixerProtocol: IMixerProtocol
mixerProtocol: MixerProtocol
mixerProtocolPresets: any
mixerProtocolList: any
socketIoClient: any
Expand Down
16 changes: 8 additions & 8 deletions client/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import { connect } from 'react-redux'
import { compose } from 'redux'
import { IStore } from '../../../shared/src/reducers/store'
import { ReduxStore } from '../../../shared/src/reducers/store'

import '../assets/css/App.css'
import Channels from './Channels'
Expand All @@ -13,13 +13,13 @@ import { withTranslation } from 'react-i18next'
import PagesSettings from './PagesSettings'
import LabelSettings from './Labels'

export interface IAppProps {
store: IStore
export interface AppProps {
store: ReduxStore
t: any
}

class App extends React.Component<IAppProps> {
constructor(props: IAppProps) {
class App extends React.Component<AppProps> {
constructor(props: AppProps) {
super(props)
}

Expand All @@ -38,7 +38,7 @@ class App extends React.Component<IAppProps> {
this.contextMenuHandler()
}

public shouldComponentUpdate(nextProps: IAppProps) {
public shouldComponentUpdate(nextProps: AppProps) {
return (
nextProps.store.settings[0].showSettings !=
this.props.store.settings[0].showSettings ||
Expand Down Expand Up @@ -133,14 +133,14 @@ class App extends React.Component<IAppProps> {
}
}

const mapStateToProps = (state: any, t: any): IAppProps => {
const mapStateToProps = (state: any, t: any): AppProps => {
return {
store: state,
t: t,
}
}

export default compose(
connect<any, IAppProps>(mapStateToProps),
connect<any, AppProps>(mapStateToProps),
withTranslation()
)(App) as any
16 changes: 8 additions & 8 deletions client/src/components/ChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { connect } from 'react-redux'
import {
SettingsActionTypes,
} from '../../../shared/src/actions/settingsActions'
import { IFader } from '../../../shared/src/reducers/fadersReducer'
import { Fader } from '../../../shared/src/reducers/fadersReducer'
import {
SOCKET_SET_FX,
SOCKET_SET_AUX_LEVEL,
Expand All @@ -19,25 +19,25 @@ import ClassNames from 'classnames'
import { fxParamsList } from '../../../shared/src/constants/MixerProtocolInterface'
import { getFaderLabel } from '../utils/labels'

interface IChanStripInjectProps {
interface ChanStripInjectProps {
label: string
selectedProtocol: string
numberOfChannelsInType: Array<number>
channel: Array<any>
fader: Array<IFader>
fader: Array<Fader>
auxSendIndex: number
offtubeMode: boolean
}

interface IChanStripProps {
interface ChanStripProps {
faderIndex: number
}

// Constants for Delay buttons:
const DEL_VALUES = [10, 1, -1, -10]

class ChanStrip extends React.PureComponent<
IChanStripProps & IChanStripInjectProps & Store
ChanStripProps & ChanStripInjectProps & Store
> {
constructor(props: any) {
super(props)
Expand Down Expand Up @@ -514,8 +514,8 @@ class ChanStrip extends React.PureComponent<
}
}

const mapStateToProps = (state: any, props: any): IChanStripInjectProps => {
let inject: IChanStripInjectProps = {
const mapStateToProps = (state: any, props: any): ChanStripInjectProps => {
let inject: ChanStripInjectProps = {
label: '',
selectedProtocol: state.settings[0].mixers[0].mixerProtocol,
numberOfChannelsInType:
Expand All @@ -540,6 +540,6 @@ const mapStateToProps = (state: any, props: any): IChanStripInjectProps => {
return inject
}

export default connect<any, IChanStripInjectProps>(mapStateToProps)(
export default connect<any, ChanStripInjectProps>(mapStateToProps)(
ChanStrip
) as any
28 changes: 14 additions & 14 deletions client/src/components/ChanStripEq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import ReactSlider from 'react-slider'
import '../assets/css/ChanStripEq.css'
import { Store } from 'redux'
import { connect } from 'react-redux'
import { IFader } from '../../../shared/src/reducers/fadersReducer'
import { IChannel } from '../../../shared/src/reducers/channelsReducer'
import { Fader } from '../../../shared/src/reducers/fadersReducer'
import { Channel } from '../../../shared/src/reducers/channelsReducer'
import { SOCKET_SET_FX } from '../../../shared/src/constants/SOCKET_IO_DISPATCHERS'
import { fxParamsList } from '../../../shared/src/constants/MixerProtocolInterface'
import { getFaderLabel } from '../utils/labels'

interface IChanStripFullInjectProps {
interface ChanStripFullInjectProps {
label: string
selectedProtocol: string
numberOfChannelsInType: Array<number>
channel: IChannel[]
fader: IFader[]
channel: Channel[]
fader: Fader[]
auxSendIndex: number
offtubeMode: boolean
}

interface IChanStripFullProps {
interface ChanStripFullProps {
faderIndex: number
}

Expand All @@ -32,11 +32,11 @@ enum EqColors {
'rgb(229, 159, 34)',
}

interface IFreqLabels {
interface FreqLabels {
label: string
posY: number
}
const EQ_FREQ_LABELS: IFreqLabels[] = [
const EQ_FREQ_LABELS: FreqLabels[] = [
{
label: '50',
posY: 340,
Expand Down Expand Up @@ -84,7 +84,7 @@ const EQ_Y_SIZE = 0.25
const EQ_Y_OFFSET = 0.55

class ChanStripEq extends React.PureComponent<
IChanStripFullProps & IChanStripFullInjectProps & Store
ChanStripFullProps & ChanStripFullInjectProps & Store
> {
canvas: HTMLCanvasElement | undefined

Expand All @@ -93,7 +93,7 @@ class ChanStripEq extends React.PureComponent<
}

shouldComponentUpdate(
nextProps: IChanStripFullInjectProps & IChanStripFullProps
nextProps: ChanStripFullInjectProps & ChanStripFullProps
) {
if (nextProps.faderIndex > -1) {
return true
Expand Down Expand Up @@ -195,7 +195,7 @@ class ChanStripEq extends React.PureComponent<
context.stroke()
// Freq on zero gain line:
context.beginPath()
EQ_FREQ_LABELS.forEach((freq: IFreqLabels) => {
EQ_FREQ_LABELS.forEach((freq: FreqLabels) => {
context.font = '30px Ariel'
context.strokeStyle = 'white'
context.strokeText(
Expand Down Expand Up @@ -425,8 +425,8 @@ class ChanStripEq extends React.PureComponent<
}
}

const mapStateToProps = (state: any, props: any): IChanStripFullInjectProps => {
let inject: IChanStripFullInjectProps = {
const mapStateToProps = (state: any, props: any): ChanStripFullInjectProps => {
let inject: ChanStripFullInjectProps = {
label: '',
selectedProtocol: state.settings[0].mixers[0].mixerProtocol,
numberOfChannelsInType:
Expand All @@ -451,6 +451,6 @@ const mapStateToProps = (state: any, props: any): IChanStripFullInjectProps => {
return inject
}

export default connect<any, IChanStripFullInjectProps>(mapStateToProps)(
export default connect<any, ChanStripFullInjectProps>(mapStateToProps)(
ChanStripEq
) as any
20 changes: 10 additions & 10 deletions client/src/components/ChanStripFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { connect } from 'react-redux'
import {
SettingsActionTypes,
} from '../../../shared/src/actions/settingsActions'
import { IFader } from '../../../shared/src/reducers/fadersReducer'
import { Fader } from '../../../shared/src/reducers/fadersReducer'
import {
SOCKET_SET_FX,
SOCKET_SET_AUX_LEVEL,
Expand All @@ -17,29 +17,29 @@ import {
import ReductionMeter from './ReductionMeter'
import ClassNames from 'classnames'
import { fxParamsList } from '../../../shared/src/constants/MixerProtocolInterface'
import { IChannel } from '../../../shared/src/reducers/channelsReducer'
import { Channel } from '../../../shared/src/reducers/channelsReducer'
import { getFaderLabel } from '../utils/labels'
import ChanStripEq from './ChanStripEq'

interface IChanStripFullInjectProps {
interface ChanStripFullInjectProps {
label: string
selectedProtocol: string
numberOfChannelsInType: Array<number>
channel: IChannel[]
fader: IFader[]
channel: Channel[]
fader: Fader[]
auxSendIndex: number
offtubeMode: boolean
}

interface IChanStripFullProps {
interface ChanStripFullProps {
faderIndex: number
}

// Constants for Delay buttons:
const DEL_VALUES = [10, 1, -1, -10]

class ChanStripFull extends React.PureComponent<
IChanStripFullProps & IChanStripFullInjectProps & Store
ChanStripFullProps & ChanStripFullInjectProps & Store
> {

constructor(props: any) {
Expand Down Expand Up @@ -523,8 +523,8 @@ class ChanStripFull extends React.PureComponent<
}
}

const mapStateToProps = (state: any, props: any): IChanStripFullInjectProps => {
let inject: IChanStripFullInjectProps = {
const mapStateToProps = (state: any, props: any): ChanStripFullInjectProps => {
let inject: ChanStripFullInjectProps = {
label: '',
selectedProtocol: state.settings[0].mixers[0].mixerProtocol,
numberOfChannelsInType:
Expand All @@ -549,6 +549,6 @@ const mapStateToProps = (state: any, props: any): IChanStripFullInjectProps => {
return inject
}

export default connect<any, IChanStripFullInjectProps>(mapStateToProps)(
export default connect<any, ChanStripFullInjectProps>(mapStateToProps)(
ChanStripFull
) as any
24 changes: 12 additions & 12 deletions client/src/components/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ import '../assets/css/NoUiSlider.css'
//assets:
import '../assets/css/Channel.css'
import * as IO from '../../../shared/src/constants/SOCKET_IO_DISPATCHERS'
import { IChannelReference, IFader } from '../../../shared/src/reducers/fadersReducer'
import { ISettings } from '../../../shared/src/reducers/settingsReducer'
import { ChannelReference, Fader } from '../../../shared/src/reducers/fadersReducer'
import { Settings } from '../../../shared/src/reducers/settingsReducer'
import { SettingsActionTypes } from '../../../shared/src/actions/settingsActions'
import { withTranslation } from 'react-i18next'
import { MixerConnectionTypes, VuLabelConversionType } from '../../shared../../../shared/src/constants/MixerProtocolInterface'
import { getFaderLabel } from '../utils/labels'
import { Conversions } from '../../../shared/src/actions/utils/dbConversion'

interface IChannelInjectProps {
interface ChannelInjectProps {
t: any
fader: IFader
settings: ISettings
fader: Fader
settings: Settings
channelType: number
channelTypeIndex: number
label: string
}

interface IChannelProps {
interface ChannelProps {
faderIndex: number
}

Expand All @@ -35,7 +35,7 @@ function XOR(a: any, b: any): boolean {
}

class Channel extends React.Component<
IChannelProps & IChannelInjectProps & Store
ChannelProps & ChannelInjectProps & Store
> {
faderIndex: number

Expand All @@ -46,7 +46,7 @@ class Channel extends React.Component<
this.faderIndex = this.props.faderIndex
}

public shouldComponentUpdate(nextProps: IChannelInjectProps) {
public shouldComponentUpdate(nextProps: ChannelInjectProps) {
return (
nextProps.channelTypeIndex !== this.props.channelTypeIndex ||
nextProps.fader.pgmOn != this.props.fader.pgmOn ||
Expand Down Expand Up @@ -161,13 +161,13 @@ class Channel extends React.Component<
</React.Fragment>
)
} else {
let assignedChannels: IChannelReference[] = this.props.fader
let assignedChannels: ChannelReference[] = this.props.fader
.assignedChannels || [{ mixerIndex: 0, channelIndex: 0 }]
return (
<React.Fragment>
{!window.location.search.includes('vu=0') &&
assignedChannels?.map(
(assigned: IChannelReference, index) => (
(assigned: ChannelReference, index) => (
<VuMeter
faderIndex={this.faderIndex}
channel={index}
Expand Down Expand Up @@ -499,7 +499,7 @@ class Channel extends React.Component<
}
}

const mapStateToProps = (state: any, props: any): IChannelInjectProps => {
const mapStateToProps = (state: any, props: any): ChannelInjectProps => {
return {
t: props.t,
fader: state.faders[0].fader[props.faderIndex],
Expand All @@ -512,6 +512,6 @@ const mapStateToProps = (state: any, props: any): IChannelInjectProps => {
}

export default compose(
connect<any, IChannelInjectProps, any>(mapStateToProps),
connect<any, ChannelInjectProps, any>(mapStateToProps),
withTranslation()
)(Channel) as any
Loading

0 comments on commit 4747f35

Please sign in to comment.