Skip to content

Commit

Permalink
changing TS union type names to use singular naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidijusParsiunas committed Oct 13, 2024
1 parent 38772a9 commit a687314
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions component/src/services/serviceIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {IWebsocketHandler} from '../utils/HTTP/customHandler';
import {Messages} from '../views/chat/messages/messages';
import {InterfacesUnion} from '../types/utilityTypes';
import {FetchFunc} from '../utils/HTTP/requestUtils';
import {FILE_TYPES} from '../types/fileTypes';
import {FILE_TYPE} from '../types/fileTypes';
import {Response} from '../types/response';
import {Connect} from '../types/connect';
import {Signals} from '../types/handler';
Expand Down Expand Up @@ -41,7 +41,7 @@ export type FileServiceIO = FilesServiceConfig & {infoModalTextMarkUp?: string};
export type CustomErrors = string[];

export type ServiceFileTypes = {
[key in FILE_TYPES]?: FileServiceIO;
[key in FILE_TYPE]?: FileServiceIO;
};

export interface ServiceIO {
Expand Down
4 changes: 2 additions & 2 deletions component/src/types/buttonTypes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {FILE_TYPES} from './fileTypes';
import {FILE_TYPE} from './fileTypes';

export type BUTTON_TYPES = FILE_TYPES | 'camera' | 'microphone' | 'submit';
export type BUTTON_TYPE = FILE_TYPE | 'camera' | 'microphone' | 'submit';
2 changes: 1 addition & 1 deletion component/src/types/fileTypes.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type FILE_TYPES = 'images' | 'gifs' | 'audio' | 'mixedFiles';
export type FILE_TYPE = 'images' | 'gifs' | 'audio' | 'mixedFiles';
4 changes: 2 additions & 2 deletions component/src/types/openAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface OpenAINewAssistant {
};
}

export type FileToolTypes = 'code_interpreter' | 'file_search' | 'images';
export type FileToolType = 'code_interpreter' | 'file_search' | 'images';

// https://platform.openai.com/docs/api-reference/assistants
export interface OpenAIAssistant {
Expand All @@ -77,7 +77,7 @@ export interface OpenAIAssistant {
new_assistant?: OpenAINewAssistant;
// if image is uploaded and this is undefined, it will default to images
// images can be used without a file tool type
files_tool_type?: FileToolTypes | ((fileNames: string[]) => FileToolTypes);
files_tool_type?: FileToolType | ((fileNames: string[]) => FileToolType);
function_handler?: AssistantFunctionHandler;
}

Expand Down
4 changes: 2 additions & 2 deletions component/src/utils/buttons/inputButtons.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {BUTTON_TYPES} from '../../types/buttonTypes';
import {BUTTON_TYPE} from '../../types/buttonTypes';

// this is mostly used for setting an order for dropup menu items
export const BUTTON_ORDER: readonly BUTTON_TYPES[] = [
export const BUTTON_ORDER: readonly BUTTON_TYPE[] = [
'camera',
'gifs',
'images',
Expand Down
4 changes: 2 additions & 2 deletions component/src/utils/files/fileTypeButtonIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {MIXED_FILES_ICON_STRING} from '../../icons/mixedFilesIcon';
import {IMAGE_ICON_STRING} from '../../icons/imageIcon';
import {AUDIO_ICON_STRING} from '../../icons/audioIcon';
import {GIF_ICON_STRING} from '../../icons/gifIcon';
import {FILE_TYPES} from '../../types/fileTypes';
import {FILE_TYPE} from '../../types/fileTypes';

type ServiceFileTypes = {
[key in FILE_TYPES]: {
[key in FILE_TYPE]: {
id: string;
svgString: string;
dropupText: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import {FileAttachmentsType} from '../../fileAttachments/fileAttachmentTypes/fil
import {ButtonContainers, ButtonContainersT} from '../../buttonContainers/buttonContainers';
import {BUTTON_ORDER} from '../../../../../utils/buttons/inputButtons';
import {DropupStyles} from '../../../../../types/dropupStyles';
import {BUTTON_TYPES} from '../../../../../types/buttonTypes';
import {BUTTON_TYPE} from '../../../../../types/buttonTypes';
import {ButtonPosition} from '../../../../../types/button';
import {InputButton} from '../inputButton';
import {Dropup} from '../../dropup/dropup';

export type Positions = {[key in ButtonPosition]: ButtonProps[]};

type ButtonProps = {button: InputButton; buttonType?: BUTTON_TYPES; fileType?: FileAttachmentsType};
type ButtonProps = {button: InputButton; buttonType?: BUTTON_TYPE; fileType?: FileAttachmentsType};

type Buttons = {
[key in BUTTON_TYPES]?: ButtonProps;
[key in BUTTON_TYPE]?: ButtonProps;
};

export class InputButtonPositions {
Expand Down
4 changes: 2 additions & 2 deletions component/src/views/chat/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import {RecordAudio} from './buttons/microphone/recordAudio';
import {SubmitButton} from './buttons/submit/submitButton';
import {CameraButton} from './buttons/camera/cameraButton';
import {DropupStyles} from '../../../types/dropupStyles';
import {BUTTON_TYPES} from '../../../types/buttonTypes';
import {BUTTON_TYPE} from '../../../types/buttonTypes';
import {InputButton} from './buttons/inputButton';
import {CustomStyle} from '../../../types/styles';
import {TextInputEl} from './textInput/textInput';
import {Messages} from '../messages/messages';
import {DeepChat} from '../../../deepChat';

export type Buttons = {
[key in BUTTON_TYPES]?: {button: InputButton; fileType?: FileAttachmentsType};
[key in BUTTON_TYPE]?: {button: InputButton; fileType?: FileAttachmentsType};
};

export class Input {
Expand Down

0 comments on commit a687314

Please sign in to comment.