UNPKG

3.29 kBTypeScriptView Raw
1import { ImageSource as ImageSourceDefinition, iosSymbolScaleType } from '.';
2import { ImageAsset } from '../image-asset';
3import { Font } from '../ui/styling/font';
4import { Color } from '../color';
5import { isFileOrResourcePath } from '../utils';
6export { isFileOrResourcePath };
7export declare class ImageSource implements ImageSourceDefinition {
8 android: android.graphics.Bitmap;
9 ios: UIImage;
10 get height(): number;
11 get width(): number;
12 get rotationAngle(): number;
13 set rotationAngle(_value: number);
14 constructor(nativeSource?: any);
15 static fromAsset(asset: ImageAsset): Promise<ImageSource>;
16 static fromUrl(url: string): Promise<ImageSource>;
17 static iosSystemScaleFor(scale: iosSymbolScaleType): UIImageSymbolScale.Default | UIImageSymbolScale.Small | UIImageSymbolScale.Medium | UIImageSymbolScale.Large;
18 static fromSystemImageSync(name: string, scale?: iosSymbolScaleType): ImageSource;
19 static fromSystemImage(name: string, scale?: iosSymbolScaleType): Promise<ImageSource>;
20 static fromResourceSync(name: string): ImageSource;
21 static fromResource(name: string): Promise<ImageSource>;
22 static fromFileSync(path: string): ImageSource;
23 static fromFile(path: string): Promise<ImageSource>;
24 static fromFileOrResourceSync(path: string): ImageSource;
25 static fromDataSync(data: any): ImageSource;
26 static fromData(data: any): Promise<ImageSource>;
27 static fromBase64Sync(source: string): ImageSource;
28 static fromBase64(source: string): Promise<ImageSource>;
29 static fromFontIconCodeSync(source: string, font: Font, color: Color): ImageSource;
30 fromAsset(asset: ImageAsset): Promise<this>;
31 loadFromResource(name: string): boolean;
32 fromResource(name: string): Promise<boolean>;
33 loadFromFile(path: string): boolean;
34 fromFile(path: string): Promise<boolean>;
35 loadFromData(data: any): boolean;
36 fromData(data: any): Promise<boolean>;
37 loadFromBase64(source: string): boolean;
38 fromBase64(source: string): Promise<boolean>;
39 loadFromFontIconCode(source: string, font: Font, color: Color): boolean;
40 setNativeSource(source: any): void;
41 saveToFile(path: string, format: 'png' | 'jpeg' | 'jpg', quality?: number): boolean;
42 saveToFileAsync(path: string, format: 'png' | 'jpeg' | 'jpg', quality?: number): Promise<boolean>;
43 toBase64String(format: 'png' | 'jpeg' | 'jpg', quality?: number): string;
44 toBase64StringAsync(format: 'png' | 'jpeg' | 'jpg', quality?: number): Promise<string>;
45 resize(maxSize: number, options?: any): ImageSource;
46 resizeAsync(maxSize: number, options?: any): Promise<ImageSource>;
47}
48export declare function fromAsset(asset: ImageAsset): Promise<ImageSource>;
49export declare function fromResource(name: string): ImageSource;
50export declare function fromFile(path: string): ImageSource;
51export declare function fromData(data: any): ImageSource;
52export declare function fromFontIconCode(source: string, font: Font, color: Color): ImageSource;
53export declare function fromBase64(source: string): ImageSource;
54export declare function fromNativeSource(nativeSource: any): ImageSource;
55export declare function fromUrl(url: string): Promise<ImageSourceDefinition>;
56export declare function fromFileOrResource(path: string): ImageSource;