Skip to content

Commit

Permalink
chore: adjusting prop order, import consolidation, and added description
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanvn committed Jan 22, 2025
1 parent 2674696 commit 0567225
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import * as React from 'react';
import { TransferProgressEvent } from 'aws-amplify/storage';
import { isFunction } from '@aws-amplify/ui';

import { PathCallback, uploadFile } from '../../utils';
import { getInput } from '../../utils';
import { StorageBucket } from '../../types';
import { FileStatus } from '../../types';
import { FileUploaderProps } from '../../types';
import { getInput, PathCallback, uploadFile } from '../../utils';
import { FileStatus, FileUploaderProps, StorageBucket } from '../../types';
import { UseFileUploader } from '../useFileUploader';

export interface UseUploadFilesProps
Expand Down
3 changes: 2 additions & 1 deletion packages/react-storage/src/components/FileUploader/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export interface FileUploaderProps {
/**
* Component overrides
*/
bucket?: never;
components?: {
Container?: React.ComponentType<ContainerProps>;
DropZone?: React.ComponentType<DropZoneProps>;
Expand Down Expand Up @@ -139,6 +138,8 @@ export interface FileUploaderProps {
path?: string;

useAccelerateEndpoint?: boolean;

bucket?: never;
}

export interface FileUploaderPathProps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface StorageImageProps extends Omit<ImageProps, 'src'> {

type OmittedPropKey =
| 'accessLevel'
| 'bucket'
| 'bucket' // include `bucket` to disallow `never` in `StorageImagePathProps`
| 'imgKey'
| 'identityId'
| 'onStorageGetError'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ export interface StorageManagerProps extends FileUploaderProps {}

export interface StorageManagerPathProps
extends Omit<StorageManagerProps, 'accessLevel' | 'bucket' | 'path'> {
/** S3 bucket, allows either a string or `BucketInfo`:
* - `string`: the "friendly name" assigned to the bucket
* - `BucketInfo`: object containing the actual S3 bucket name and its region
*/
bucket?: StorageBucket;
/**
* S3 bucket key, allows either a `string` or a `PathCallback`:
* - `string`: `path` is prefixed to the file `key` for each file
* - `PathCallback`: callback provided an input containing the current `identityId`,
* resolved value is prefixed to the file `key` for each file
*/
bucket?: StorageBucket;
path: string | PathCallback;
accessLevel?: never;
useAccelerateEndpoint?: boolean;
Expand Down

0 comments on commit 0567225

Please sign in to comment.