expect-actual

Community

Unify cross-platform APIs with Kotlin expect/actual.

Authorahmed3elshaer
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Kotlin Multiplatform's expect/actual pattern separates shared API surface from platform-specific implementations, reducing duplication and ensuring a clean single source of truth.

Core Features & Use Cases

  • Shared interfaces: declare API contracts in commonMain and provide per-platform implementations in androidMain and iosMain.
  • Platform-specific behavior: implement platform-specific logic behind a common API without leaking platform details to shared code.
  • Use Case: build a cross-platform feature like file system access that behaves consistently on Android and iOS by supplying actual implementations for each platform.

Quick Start

Define expect declarations in commonMain to describe the API surface. Implement actual declarations in androidMain and iosMain to fulfill the platform-specific behavior. Optionally add commonTest tests to verify cross-platform consistency.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: expect-actual
Download link: https://github.com/ahmed3elshaer/everything-claude-code-mobile/archive/main.zip#expect-actual

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.