Skip to content

pantoken / packages/core/src / toXcodeImageset

Fonksiyon: toXcodeImageset()

toXcodeImageset(name, svg): AssetFile[]

Beta

Bir SVG barındıran Xcode asset-catalog imageset'i için dosyaları oluşturur (vektör korunumu ile; böylece iOS 13+ üzerinde ölçeklenir ve renklendirilir). .svg ve onun Contents.json değerlerini döndürür.

Parametreler

name

string

Simge adı (imageset klasör adı).

svg

string

Satır içi SVG işaretlemesi.

Döndürür

AssetFile[]

Imageset'in dosyaları; yollar .xcassets köküne göre göreli.

Örnek

ts
import { toXcodeImageset } from "@pantoken/core";

const files = toXcodeImageset("arrow-left", "<svg viewBox='0 0 24 24'/>");
// → [
//   { path: "arrow-left.imageset/arrow-left.svg", content: "<svg…" },
//   { path: "arrow-left.imageset/Contents.json", content: "{…preserves-vector-representation…}" },
// ]