Skip to content

Commit

Permalink
feat: Replaced Typescript Or with Enum for schema column, for better …
Browse files Browse the repository at this point in the history
…intellisense
  • Loading branch information
chavda-bhavik committed Sep 13, 2023
1 parent 8e27a67 commit 4468b1e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions packages/react/src/components/button/Button.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ export enum EventTypesEnum {
UPLOAD_COMPLETED = 'UPLOAD_COMPLETED',
}

export interface ISchemaItem {
key: string;
name: string;
alternateKeys?: string[];
isRequired?: boolean;
isUnique?: boolean;
selectValues?: string[];
type?: 'String' | 'Number' | 'Date' | 'Email' | 'Regex' | 'Select' | 'Any';
regex?: string;
}

export type EventCalls =
| {
type: EventTypesEnum.UPLOAD_STARTED;
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/hooks/useImpler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import { logError } from '../utils/logger';
import { EventTypesEnum, IShowPayload, IUpload, ISchemaItem } from '@impler/shared';
import { EventCalls, UploadTemplateData, UploadData } from '../components/button/Button.types';
import { EventTypesEnum, IShowPayload, IUpload } from '@impler/shared';
import { EventCalls, UploadTemplateData, UploadData, ISchemaItem } from '../components/button/Button.types';

interface ShowWidgetProps {
colorScheme?: 'light' | 'dark';
Expand Down

0 comments on commit 4468b1e

Please sign in to comment.