react-native-multiple-image-picker icon indicating copy to clipboard operation
react-native-multiple-image-picker copied to clipboard

Typescript return type for openPicker is Promise<Result[]> but it is actually Promise<Result> when singleSelectedMode is true

Open kevinstubbs opened this issue 3 years ago • 0 comments

There's a discrepancy here between the TypeScript definition and the actual code.

src/index.d.ts openPicker(options: Options): Promise<Results[]>;

src/index.js

      try {
        const response = await MultipleImagePicker.openPicker(options);
        // console.log('res', response);
        if (response?.length) {
          if (isSingle) {
            resolve(response[0]);
          }
          resolve(response);
          return;
        }
        resolve([]);
      } catch (e) {
        reject(e);
      }

kevinstubbs avatar Jan 16 '22 15:01 kevinstubbs