API Documentation Template - uoftblueprint/the-period-purse-ios GitHub Wiki
Helpful pages:
- JS types: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures (JS is not strongly typed but let's be certain of what values are expected and retrieved)
BLANK FORMAT BELOW
- Add a description about what the method does
- What
react-native-fs (RNFS) API(s)
and/orGoogle 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?
static functionName(x: string, y: boolean): ReturnType
- 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)
- 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
- Then return
static GETLessonPlanSize(name: str): int
- Returns int (0 if file doesn't exist)