From 7622c142cbfe8c988e39a2eb634e4d68cdfd5f94 Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Wed, 27 Sep 2023 07:25:55 +0200 Subject: [PATCH] fix: set all default return-data to be unknown instead of undefined As suggested by @ianshade, for a better dev experience --- src/commands.ts | 168 ++++++++++++++++++++++-------------------------- 1 file changed, 78 insertions(+), 90 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index 9f9f1e8f..3cba462e 100755 --- a/src/commands.ts +++ b/src/commands.ts @@ -192,91 +192,79 @@ export interface TypedResponseCommand = AllTypedCommands[C]['returnType'] export interface AllTypedCommands { - [Commands.Loadbg]: TypedResponseCommand - [Commands.LoadbgDecklink]: TypedResponseCommand - [Commands.LoadbgHtml]: TypedResponseCommand - [Commands.LoadbgRoute]: TypedResponseCommand - [Commands.Load]: TypedResponseCommand - [Commands.Play]: TypedResponseCommand - [Commands.PlayDecklink]: TypedResponseCommand - [Commands.PlayHtml]: TypedResponseCommand - [Commands.PlayRoute]: TypedResponseCommand - [Commands.Pause]: TypedResponseCommand - [Commands.Resume]: TypedResponseCommand - [Commands.Stop]: TypedResponseCommand - [Commands.Clear]: TypedResponseCommand - [Commands.Call]: TypedResponseCommand - [Commands.Swap]: TypedResponseCommand - [Commands.Add]: TypedResponseCommand - [Commands.Remove]: TypedResponseCommand - [Commands.Print]: TypedResponseCommand - [Commands.LogLevel]: TypedResponseCommand - [Commands.LogCategory]: TypedResponseCommand - [Commands.Set]: TypedResponseCommand - [Commands.Lock]: TypedResponseCommand - [Commands.DataStore]: TypedResponseCommand - [Commands.DataRetrieve]: TypedResponseCommand - [Commands.DataList]: TypedResponseCommand - [Commands.DataRemove]: TypedResponseCommand - [Commands.CgAdd]: TypedResponseCommand - [Commands.CgPlay]: TypedResponseCommand - [Commands.CgStop]: TypedResponseCommand - [Commands.CgNext]: TypedResponseCommand - [Commands.CgRemove]: TypedResponseCommand - [Commands.CgClear]: TypedResponseCommand - [Commands.CgUpdate]: TypedResponseCommand - [Commands.CgInvoke]: TypedResponseCommand - [Commands.CgInfo]: TypedResponseCommand - [Commands.MixerKeyer]: TypedResponseCommand - [Commands.MixerChroma]: TypedResponseCommand - [Commands.MixerBlend]: TypedResponseCommand - [Commands.MixerInvert]: TypedResponseCommand - [Commands.MixerOpacity]: TypedResponseCommand - [Commands.MixerBrightness]: TypedResponseCommand - [Commands.MixerSaturation]: TypedResponseCommand - [Commands.MixerContrast]: TypedResponseCommand - [Commands.MixerLevels]: TypedResponseCommand - [Commands.MixerFill]: TypedResponseCommand - [Commands.MixerClip]: TypedResponseCommand - [Commands.MixerAnchor]: TypedResponseCommand - [Commands.MixerCrop]: TypedResponseCommand - [Commands.MixerRotation]: TypedResponseCommand - [Commands.MixerPerspective]: TypedResponseCommand - [Commands.MixerMipmap]: TypedResponseCommand - [Commands.MixerVolume]: TypedResponseCommand - [Commands.MixerMastervolume]: TypedResponseCommand< - Commands.MixerMastervolume, - MixerMastervolumeParameters, - undefined - > + [Commands.Loadbg]: TypedResponseCommand + [Commands.LoadbgDecklink]: TypedResponseCommand + [Commands.LoadbgHtml]: TypedResponseCommand + [Commands.LoadbgRoute]: TypedResponseCommand + [Commands.Load]: TypedResponseCommand + [Commands.Play]: TypedResponseCommand + [Commands.PlayDecklink]: TypedResponseCommand + [Commands.PlayHtml]: TypedResponseCommand + [Commands.PlayRoute]: TypedResponseCommand + [Commands.Pause]: TypedResponseCommand + [Commands.Resume]: TypedResponseCommand + [Commands.Stop]: TypedResponseCommand + [Commands.Clear]: TypedResponseCommand + [Commands.Call]: TypedResponseCommand + [Commands.Swap]: TypedResponseCommand + [Commands.Add]: TypedResponseCommand + [Commands.Remove]: TypedResponseCommand + [Commands.Print]: TypedResponseCommand + [Commands.LogLevel]: TypedResponseCommand + [Commands.LogCategory]: TypedResponseCommand + [Commands.Set]: TypedResponseCommand + [Commands.Lock]: TypedResponseCommand + [Commands.DataStore]: TypedResponseCommand + [Commands.DataRetrieve]: TypedResponseCommand + [Commands.DataList]: TypedResponseCommand + [Commands.DataRemove]: TypedResponseCommand + [Commands.CgAdd]: TypedResponseCommand + [Commands.CgPlay]: TypedResponseCommand + [Commands.CgStop]: TypedResponseCommand + [Commands.CgNext]: TypedResponseCommand + [Commands.CgRemove]: TypedResponseCommand + [Commands.CgClear]: TypedResponseCommand + [Commands.CgUpdate]: TypedResponseCommand + [Commands.CgInvoke]: TypedResponseCommand + [Commands.CgInfo]: TypedResponseCommand + [Commands.MixerKeyer]: TypedResponseCommand + [Commands.MixerChroma]: TypedResponseCommand + [Commands.MixerBlend]: TypedResponseCommand + [Commands.MixerInvert]: TypedResponseCommand + [Commands.MixerOpacity]: TypedResponseCommand + [Commands.MixerBrightness]: TypedResponseCommand + [Commands.MixerSaturation]: TypedResponseCommand + [Commands.MixerContrast]: TypedResponseCommand + [Commands.MixerLevels]: TypedResponseCommand + [Commands.MixerFill]: TypedResponseCommand + [Commands.MixerClip]: TypedResponseCommand + [Commands.MixerAnchor]: TypedResponseCommand + [Commands.MixerCrop]: TypedResponseCommand + [Commands.MixerRotation]: TypedResponseCommand + [Commands.MixerPerspective]: TypedResponseCommand + [Commands.MixerMipmap]: TypedResponseCommand + [Commands.MixerVolume]: TypedResponseCommand + [Commands.MixerMastervolume]: TypedResponseCommand [Commands.MixerStraightAlphaOutput]: TypedResponseCommand< Commands.MixerStraightAlphaOutput, MixerStraightAlphaOutputParameters, - undefined - > - [Commands.MixerGrid]: TypedResponseCommand - [Commands.MixerCommit]: TypedResponseCommand - [Commands.MixerClear]: TypedResponseCommand - [Commands.ChannelGrid]: TypedResponseCommand - [Commands.ThumbnailList]: TypedResponseCommand - [Commands.ThumbnailRetrieve]: TypedResponseCommand< - Commands.ThumbnailRetrieve, - ThumbnailRetrieveParameters, - undefined - > - [Commands.ThumbnailGenerate]: TypedResponseCommand< - Commands.ThumbnailGenerate, - ThumbnailGenerateParameters, - undefined + unknown > + [Commands.MixerGrid]: TypedResponseCommand + [Commands.MixerCommit]: TypedResponseCommand + [Commands.MixerClear]: TypedResponseCommand + [Commands.ChannelGrid]: TypedResponseCommand + [Commands.ThumbnailList]: TypedResponseCommand + [Commands.ThumbnailRetrieve]: TypedResponseCommand + [Commands.ThumbnailGenerate]: TypedResponseCommand [Commands.ThumbnailGenerateAll]: TypedResponseCommand< Commands.ThumbnailGenerateAll, ThumbnailGenerateAllParameters, - undefined + unknown > - [Commands.Cinf]: TypedResponseCommand + [Commands.Cinf]: TypedResponseCommand [Commands.Cls]: TypedResponseCommand - [Commands.Fls]: TypedResponseCommand + [Commands.Fls]: TypedResponseCommand [Commands.Tls]: TypedResponseCommand [Commands.Version]: TypedResponseCommand [Commands.Info]: TypedResponseCommand @@ -286,20 +274,20 @@ export interface AllTypedCommands { InfoChannelEntry | undefined > [Commands.InfoLayer]: TypedResponseCommand - [Commands.InfoTemplate]: TypedResponseCommand - [Commands.InfoConfig]: TypedResponseCommand - [Commands.InfoPaths]: TypedResponseCommand - [Commands.InfoSystem]: TypedResponseCommand - [Commands.InfoServer]: TypedResponseCommand - [Commands.InfoQueues]: TypedResponseCommand - [Commands.InfoThreads]: TypedResponseCommand - [Commands.InfoDelay]: TypedResponseCommand - [Commands.Diag]: TypedResponseCommand - [Commands.GlInfo]: TypedResponseCommand - [Commands.GlGc]: TypedResponseCommand - [Commands.Bye]: TypedResponseCommand - [Commands.Kill]: TypedResponseCommand - [Commands.Restart]: TypedResponseCommand + [Commands.InfoTemplate]: TypedResponseCommand + [Commands.InfoConfig]: TypedResponseCommand + [Commands.InfoPaths]: TypedResponseCommand + [Commands.InfoSystem]: TypedResponseCommand + [Commands.InfoServer]: TypedResponseCommand + [Commands.InfoQueues]: TypedResponseCommand + [Commands.InfoThreads]: TypedResponseCommand + [Commands.InfoDelay]: TypedResponseCommand + [Commands.Diag]: TypedResponseCommand + [Commands.GlInfo]: TypedResponseCommand + [Commands.GlGc]: TypedResponseCommand + [Commands.Bye]: TypedResponseCommand + [Commands.Kill]: TypedResponseCommand + [Commands.Restart]: TypedResponseCommand } export type LoadbgCommand = AllTypedCommands[Commands.Loadbg]['command']