gantri-components 2.133.0-beta.2 → 2.133.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,6 +59,7 @@ export interface FileMetaData {
59
59
  }
60
60
  export interface SelectedFileDetails {
61
61
  fileBlob: Blob;
62
+ fileExtension: string;
62
63
  fileName: string;
63
64
  fileSize: number;
64
65
  metadata: FileMetaData;
@@ -2,5 +2,6 @@ export * from './get-base-64-from-blob';
2
2
  export * from './get-purified-file-name';
3
3
  export * from './get-valid-files';
4
4
  export * from './transform-file-name';
5
+ export * from './validate-file-extension';
5
6
  export * from './validate-file-size';
6
7
  export * from './validate-image-dimensions';
@@ -0,0 +1 @@
1
+ export * from './validate-file-extension';
@@ -0,0 +1,3 @@
1
+ import { ValidateExtensionsProps } from './validate-file-extension.types';
2
+ /** Validates when files are added via drag and drop. */
3
+ export declare const validateExtensions: (props: ValidateExtensionsProps) => string | undefined;
@@ -0,0 +1,4 @@
1
+ export interface ValidateExtensionsProps {
2
+ expectedExtensions: string[];
3
+ fileExtension: string;
4
+ }
@@ -1,3 +1,3 @@
1
- import { ValidateImageScale } from './validate-image-dimensions.types';
2
- /** Returns an error message if invalid. */
3
- export declare const validateImageDimensions: (props: ValidateImageScale) => string | undefined;
1
+ import { ValidateImageDimensionsProps } from './validate-image-dimensions.types';
2
+ /** Returns error message if invalid. */
3
+ export declare const validateImageDimensions: (props: ValidateImageDimensionsProps) => Promise<string | undefined>;
@@ -1,6 +1,13 @@
1
- export type ValidateImageScale = {
1
+ export type ValidateDimensionsProps = {
2
2
  fileName: string;
3
3
  img: HTMLImageElement;
4
4
  minHeight: number;
5
5
  minWidth: number;
6
6
  };
7
+ export interface ValidateImageDimensionsProps {
8
+ fileName: string;
9
+ minHeight: number;
10
+ minWidth: number;
11
+ /** If file is a `Blob`, convert to base64 `src` using `getBase64FromBlob`. */
12
+ src: string;
13
+ }