API Documentation Template - uoftblueprint/the-period-purse-ios GitHub Wiki

Helpful pages:


BLANK FORMAT BELOW


<App Page>

/<API Method Name/>

  • Add a description about what the method does
  • What react-native-fs (RNFS) API(s) and/or Google Drive API(s) does it call? In what order?
  • Are there iOS or Android-only RNFS APIs you might need to be calling here?
  • What does it store/modify? What file stucture are you storing the value with in RNFS?
  • What does it retrieve? What file are you looking up in RNFS? Is it ok if it's not there?
  • What does it delete? What file are you deleting in RNFS?

Signature

static functionName(x: string, y: boolean): ReturnType

Returns

  • What does it return? In most cases a promise, but if you are retrieving a value, specify the type, or domain of values if applicable

EXAMPLE BELOW (This is not a method we need on the app, it's just a random one I'm using as an example)


LessonPlan

GETLessonPlanSize

  • This will get the lesson plan size in bytes
  • Generate filepath using name
  • Calls RNFS.stat(<filepath>) which returns Promise<StatResult>
    • Then return statResult.size or 0 if file doesn't exist

Signature

static GETLessonPlanSize(name: str): int

Returns

  • Returns int (0 if file doesn't exist)
⚠️ **GitHub.com Fallback** ⚠️