Skip to content

pantoken-root / platforms/swift/src / generateSwift

Fonction: generateSwift() ​

generateSwift(options): Promise<string>

Expérimental

Générer du Swift pour un thème nommé (en utilisant l'IR @pantoken/tokens inclus).

Paramètres ​

options ​

GenerateSwiftOptions

Renvoie ​

Promise<string>

Le chemin du fichier Swift écrit.

Exemple ​

ts
import { generateSwift } from "@pantoken/swift";

const file = await generateSwift({
  outDir: "./Sources/Tokens",
  theme: "rebrand",
  className: "PanTokens",
  icons: ["add", "check"], // optional: also emit an Icons.xcassets catalog
});