@iframe-resizer/core 6.0.0-beta.0 → 6.0.0-beta.2

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.
package/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- /**
2
- * Shared type definitions for iframe-resizer.
3
- * Canonical source of truth for the parent-side public API.
4
- */
1
+ import { AUTO, BOTH, COLLAPSE, EXPAND, HORIZONTAL, NONE, OMIT, VERTICAL } from '../common/consts';
2
+ export type Direction = typeof VERTICAL | typeof HORIZONTAL | typeof NONE | typeof BOTH;
3
+ export type LogOption = boolean | typeof EXPAND | typeof COLLAPSE | number;
4
+ export type ScrollOption = boolean | typeof AUTO | typeof OMIT;
5
5
  export interface IFrameObject {
6
6
  /** Remove the iframe from the page. */
7
7
  close(): void;
@@ -61,7 +61,7 @@ export interface IFrameOptions {
61
61
  */
62
62
  checkOrigin?: boolean | string[];
63
63
  /** Set the resizing direction of the iframe. */
64
- direction?: 'vertical' | 'horizontal' | 'none' | 'both';
64
+ direction?: Direction;
65
65
  /** Custom iframe id. */
66
66
  id?: string;
67
67
  /**
@@ -72,11 +72,11 @@ export interface IFrameOptions {
72
72
  /** Set iframe-resizer license key. */
73
73
  license: string;
74
74
  /** Enable/disable console logging. */
75
- log?: boolean | 'expanded' | 'collapsed' | number;
75
+ log?: LogOption;
76
76
  /** Set offset size of iframe content. */
77
77
  offsetSize?: number;
78
78
  /** Enable scroll bars in the iframe. */
79
- scrolling?: boolean | 'auto' | 'omit';
79
+ scrolling?: ScrollOption;
80
80
  /**
81
81
  * Set the number of pixels the iframe content size has to change by,
82
82
  * before triggering a resize of the iframe.