wmcmahan / react-native-calendar-events

📆 React Native Module for iOS and Android Calendar Events
MIT License
906 stars 292 forks source link

`RNCalendarEvents.requestPermissions()` isn't declared in `index.d.ts` file? #315

Closed arlovip closed 4 years ago

arlovip commented 4 years ago

Environment

info Fetching system and libraries information...
System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
    Memory: 131.94 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.6.0 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.4 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 24, 26, 27, 28, 29
      Build Tools: 26.0.2, 27.0.3, 28.0.2, 28.0.3, 29.0.2, 30.0.0
      System Images: android-24 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
      Android NDK: 16.1.4479499
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6514223
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_161 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
  npmGlobalPackages:
    *react-native*: Not Found

The version I'm using for this repo: "react-native-calendar-events": "^2.0.0"

Steps to Reproduce

  1. Install it correctly following README.md
  2. Import like import RNCalendarEvents from 'react-native-calendar-events';
  3. Use requestPermissions() to request permission but no any prompt?

Expected Behavior

RNCalendarEvents.requestPermissions() can be declared in TypeScript file index.d.ts?

Actual Behavior

RNCalendarEvents.requestPermissions() isn't declared in TypeScript file index.d.ts. The code snippets can be seen in file index.d.ts like


export default class ReactNativeCalendarEvents {
  /** Get calendar authorization status. */
  static checkPermissions(): Promise<AuthorizationStatus>;
  /** Request calendar authorization. Authorization must be granted before accessing calendar events. */
  static checkPermissions(): Promise<AuthorizationStatus>; // ---------- this line should be `requestPermissions()`, right?

  /** Finds all the calendars on the device. */
  static findCalendars(): Promise<Calendar[]>;
  /** Create a calendar.
   * @param calendar - Calendar to create
   */

......
}

The issue is just for document optimization. Thanks for this repo. 😊

wmcmahan commented 4 years ago

Thanks @lchenfox. PR #316 should resolve this soon.

arlovip commented 4 years ago

👍Okay. Closing the issue.

MoOx commented 4 years ago

Oooopsy, sorry for this small mistake. Fixed & released as 2.0.1