@thinkersteps_labs/3d-viewer-angular 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,96 +0,0 @@
1
- import { EventEmitter, OnChanges, AfterViewInit, OnDestroy, SimpleChanges } from '@angular/core';
2
- import { type Viewer, type ModelSource, type ViewerOptions, type ViewerState, type PartInfo, type PartType } from '@3d-viewer/core';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * Angular wrapper for @3d-viewer/core.
6
- *
7
- * Usage (standalone):
8
- * import { ViewerComponent } from '@3d-viewer/angular'
9
- *
10
- * Usage (NgModule — for Angular 18 apps like AngularJMS):
11
- * import { ViewerModule } from '@3d-viewer/angular'
12
- *
13
- * @example
14
- * ```html
15
- * <td-viewer
16
- * [source]="modelSource"
17
- * [metalColor]="'18k-yellow-gold'"
18
- * (loaded)="onLoaded($event)"
19
- * (error)="onError($event)"
20
- * ></td-viewer>
21
- * ```
22
- */
23
- export declare class ViewerComponent implements AfterViewInit, OnChanges, OnDestroy {
24
- /** The 3D model to load. Supports URL or raw ArrayBuffer/Blob. Set null to unload. */
25
- source: ModelSource | null;
26
- /** Metal preset ID or hex color string. Reactive post-init. */
27
- metalColor?: string;
28
- /** Stone preset ID or hex color string. Reactive post-init. */
29
- stoneColor?: string;
30
- /** Background color as hex string or number. */
31
- background?: string | number;
32
- /** Metal HDR environment URL or buffer. */
33
- metalEnvUrl?: string | ArrayBuffer;
34
- /** Gemstone HDR environment URL or buffer. */
35
- gemEnvUrl?: string | ArrayBuffer;
36
- /** Camera field of view. */
37
- fov?: number;
38
- /** Enable shadow rendering. */
39
- shadows?: boolean;
40
- /**
41
- * Init-time viewer options (background, fov, shadows, etc.).
42
- * Changes after mount are ignored — use dedicated reactive inputs instead.
43
- */
44
- options?: ViewerOptions;
45
- /**
46
- * Reactive auto-rotation toggle. Calls startRotation() / stopRotation() on change.
47
- * Overrides the autoRotate flag in `options` after initialization.
48
- */
49
- autoRotate?: boolean;
50
- /**
51
- * Reactive render quality. Calls setQuality() on change.
52
- * Overrides the quality flag in `options` after initialization.
53
- */
54
- quality?: 'low' | 'medium' | 'high';
55
- /**
56
- * Full viewer state object. When changed, calls viewer.setState() — a COMPLETE
57
- * replace of metalColor, stoneColor, camera, and part overrides. Not a merge.
58
- * Takes precedence over individual metalColor / stoneColor inputs.
59
- */
60
- state?: ViewerState;
61
- /** Emits classified part list when model finishes loading. $event = PartInfo[] */
62
- loaded: EventEmitter<PartInfo[]>;
63
- /** Emits loading progress 0-1. $event = number */
64
- progress: EventEmitter<number>;
65
- /** Emits clicked part info. $event = { meshId: string, type: PartType } */
66
- partSelected: EventEmitter<{
67
- meshId: string;
68
- type: PartType;
69
- }>;
70
- /** Emits Error when model loading fails. */
71
- error: EventEmitter<Error>;
72
- /**
73
- * Emits full ViewerState on every metal/stone/camera change.
74
- * Use for persistence, undo history, or sharing a viewer URL.
75
- * Note: OrbitControls dragging emits state updates continuously.
76
- */
77
- change: EventEmitter<ViewerState>;
78
- private containerRef;
79
- private viewer;
80
- private abortCtrl;
81
- private initRafId;
82
- /**
83
- * Source received before viewer is initialized. Applied in ngAfterViewInit.
84
- * Needed because ngOnChanges fires before ngAfterViewInit on first render.
85
- */
86
- private pendingSource;
87
- /** Direct access to underlying @3d-viewer/core instance (null before mount/after destroy). */
88
- getViewer(): Viewer | null;
89
- ngAfterViewInit(): void;
90
- ngOnChanges(changes: SimpleChanges): void;
91
- ngOnDestroy(): void;
92
- private _loadSource;
93
- private _isSameSource;
94
- static ɵfac: i0.ɵɵFactoryDeclaration<ViewerComponent, never>;
95
- static ɵcmp: i0.ɵɵComponentDeclaration<ViewerComponent, "td-viewer", never, { "source": { "alias": "source"; "required": false; }; "metalColor": { "alias": "metalColor"; "required": false; }; "stoneColor": { "alias": "stoneColor"; "required": false; }; "background": { "alias": "background"; "required": false; }; "metalEnvUrl": { "alias": "metalEnvUrl"; "required": false; }; "gemEnvUrl": { "alias": "gemEnvUrl"; "required": false; }; "fov": { "alias": "fov"; "required": false; }; "shadows": { "alias": "shadows"; "required": false; }; "options": { "alias": "options"; "required": false; }; "autoRotate": { "alias": "autoRotate"; "required": false; }; "quality": { "alias": "quality"; "required": false; }; "state": { "alias": "state"; "required": false; }; }, { "loaded": "loaded"; "progress": "progress"; "partSelected": "partSelected"; "error": "error"; "change": "change"; }, never, never, true, never>;
96
- }
@@ -1,18 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./viewer.component";
3
- /**
4
- * Import this module in NgModule-based Angular apps (Angular 18 style, like AngularJMS).
5
- *
6
- * @example
7
- * ```typescript
8
- * import { ViewerModule } from '@3d-viewer/angular'
9
- *
10
- * @NgModule({ imports: [ViewerModule] })
11
- * export class YourFeatureModule {}
12
- * ```
13
- */
14
- export declare class ViewerModule {
15
- static ɵfac: i0.ɵɵFactoryDeclaration<ViewerModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<ViewerModule, never, [typeof i1.ViewerComponent], [typeof i1.ViewerComponent]>;
17
- static ɵinj: i0.ɵɵInjectorDeclaration<ViewerModule>;
18
- }