tools/notes/CorePlatformModules.md
Modules in packages/core split per platform by filename suffix. The bundler resolves the suffix at build time, so foo.ios.ts and foo.android.ts are two implementations of the same module. See CreateNewModule.md for a walkthrough of creating a module from scratch.
foo.ios.ts / foo.android.ts — platform implementations. Both must export the same public API.foo-common.ts — shared logic; platform files import and extend it.foo.d.ts — handwritten declaration of the merged public API. NOT generated..d.ts file in the same change..d.ts file — it is what ships to consumers and feeds the API reference docs..ios.ts or .android.ts file from -common.ts or other shared code. Shared code stays platform-agnostic; platform selection happens through the bundler..visionos.ts suffix.__ANDROID__, __IOS__, __APPLE__, __VISIONOS__ (declared in packages/core/global-types.d.ts). Guarded branches are stripped from the other platform's build, so keep platform API access inside these guards.android.*, UIKit, NS*) may only be referenced in the matching platform file, never in shared code outside a platform guard.