UNPKG

2.96 kBTypeScriptView Raw
1import { ImageSource as ImageSourceDefinition } from '.';
2import { ImageAsset } from '../image-asset';
3import { isFileOrResourcePath } from '../utils';
4import { Font } from '../ui/styling/font';
5import { Color } from '../color';
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 private _rotationAngle;
13 get rotationAngle(): number;
14 set rotationAngle(value: number);
15 constructor(nativeSource?: any);
16 static fromAsset(asset: ImageAsset): Promise<ImageSource>;
17 static fromUrl(url: string): Promise<ImageSourceDefinition>;
18 static fromResourceSync(name: string): ImageSource;
19 static fromResource(name: string): Promise<ImageSource>;
20 static fromFileSync(path: string): ImageSource;
21 static fromFile(path: string): Promise<ImageSource>;
22 static fromFileOrResourceSync(path: string): ImageSource;
23 static fromDataSync(data: any): ImageSource;
24 static fromData(data: any): Promise<ImageSource>;
25 static fromBase64Sync(source: string): ImageSource;
26 static fromBase64(source: string): Promise<ImageSource>;
27 static fromFontIconCodeSync(source: string, font: Font, color: Color): ImageSource;
28 fromAsset(asset: ImageAsset): Promise<ImageSource>;
29 loadFromResource(name: string): boolean;
30 fromResource(name: string): Promise<boolean>;
31 loadFromFile(path: string): boolean;
32 fromFile(path: string): Promise<boolean>;
33 loadFromData(data: any): boolean;
34 fromData(data: any): Promise<boolean>;
35 loadFromBase64(source: string): boolean;
36 fromBase64(data: any): Promise<boolean>;
37 loadFromFontIconCode(source: string, font: Font, color: Color): boolean;
38 setNativeSource(source: any): void;
39 saveToFile(path: string, format: 'png' | 'jpeg' | 'jpg', quality?: number): boolean;
40 saveToFileAsync(path: string, format: 'png' | 'jpeg' | 'jpg', quality?: number): Promise<boolean>;
41 toBase64String(format: 'png' | 'jpeg' | 'jpg', quality?: number): string;
42 toBase64StringAsync(format: 'png' | 'jpeg' | 'jpg', quality?: number): Promise<string>;
43 resize(maxSize: number, options?: any): ImageSource;
44 resizeAsync(maxSize: number, options?: any): Promise<ImageSource>;
45}
46export declare function fromAsset(asset: ImageAsset): Promise<ImageSource>;
47export declare function fromResource(name: string): ImageSource;
48export declare function fromFile(path: string): ImageSource;
49export declare function fromData(data: any): ImageSource;
50export declare function fromFontIconCode(source: string, font: Font, color: Color): ImageSource;
51export declare function fromBase64(source: string): ImageSource;
52export declare function fromNativeSource(nativeSource: any): ImageSource;
53export declare function fromUrl(url: string): Promise<ImageSourceDefinition>;
54export declare function fromFileOrResource(path: string): ImageSource;