@iframe-resizer/child 6.0.0-beta.0 → 6.0.0-beta.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/child",
3
- "version": "6.0.0-beta.0",
3
+ "version": "6.0.0-beta.10",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -19,8 +19,7 @@
19
19
  },
20
20
  "main": "index.cjs.js",
21
21
  "module": "index.esm.js",
22
- "browser": "index.umd.js",
23
- "types": "iframe-resizer.child.d.ts",
22
+ "types": "index.d.ts",
24
23
  "keywords": [
25
24
  "iframe",
26
25
  "Resizing",
@@ -35,6 +34,7 @@
35
34
  "child"
36
35
  ],
37
36
  "dependencies": {
37
+ "@iframe-resizer/common": "6.0.0-beta.10",
38
38
  "auto-console-group": "1.3.0"
39
39
  }
40
40
  }
@@ -1,164 +0,0 @@
1
- /**
2
- * @fileoverview Type definitions for @iframe-resizer/child
3
- *
4
- * This is a fork of the DefinitelyTyped type definitions for iframe-resizer,
5
- * updated to include the new API methods/options and remove deprecated ones.
6
- * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/iframe-resizer/index.d.ts
7
- *
8
- * I'm not a TypeScript dev, so please feel free to submit PRs to improve this file.
9
- */
10
-
11
- declare module '@iframe-resizer/child' {
12
- namespace iframeResizer {
13
- // eslint-disable-next-line @typescript-eslint/naming-convention
14
- interface IFramePageOptions {
15
- /**
16
- * This option allows you to restrict the domain of the parent page,
17
- * to prevent other sites mimicking your parent page.
18
- */
19
-
20
- ignoreSelector?: string | undefined
21
-
22
- offsetSize?: number | undefined
23
-
24
- sizeSelector?: string | undefined
25
-
26
- targetOrigin?: string | undefined
27
-
28
- /**
29
- * Called before new size is set. Return a number to modify the new size.
30
- */
31
- onBeforeResize?(newSize: number): number
32
-
33
- /**
34
- * Receive message posted from the parent page with the iframe.iframeResizer.sendMessage() method.
35
- */
36
- onMessage?(message: any): void
37
-
38
- /**
39
- * This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page.
40
- */
41
- onReady?(): void
42
- }
43
-
44
- // eslint-disable-next-line @typescript-eslint/naming-convention
45
- interface IFramePage {
46
- /**
47
- * Turn autoResizing of the iFrame on and off. Returns bool of current state.
48
- */
49
- autoResize(resize?: boolean): boolean
50
-
51
- /**
52
- * Remove the iFrame from the parent page.
53
- */
54
- close(): void
55
-
56
- /**
57
- * Returns the ID of the iFrame that the page is contained in.
58
- */
59
- getId(): string
60
-
61
- /**
62
- * Returns the origin of the parent page that the iFrame is contained in.
63
- */
64
- getParentOrigin(): string
65
-
66
- /**
67
- * Ask the containing page for its positioning coordinates.
68
- *
69
- * Your callback function will be recalled when the parent page is scrolled or resized.
70
- *
71
- * Pass false to disable the callback.
72
- */
73
- getParentProps(callback: (data: ParentProps) => void): () => void
74
-
75
- /**
76
- * Move to anchor in parent page.
77
- */
78
- moveToAnchor(hash: string): void
79
-
80
- /**
81
- * Scroll the parent page by x and y
82
- */
83
- scrollBy(x: number, y: number): void
84
-
85
- /**
86
- * Scroll the parent page to the coordinates x and y
87
- */
88
- scrollTo(x: number, y: number): void
89
-
90
- /**
91
- * Scroll the parent page to the coordinates x and y relative to the position of the iFrame.
92
- */
93
- scrollToOffset(x: number, y: number): void
94
-
95
- /**
96
- * Send data to the containing page, message can be any data type that can be serialized into JSON. The `targetOrigin`
97
- * option is used to restrict where the message is sent to; to stop an attacker mimicking your parent page.
98
- * See the MDN documentation on postMessage for more details.
99
- */
100
- sendMessage(message: any, targetOrigin?: string): void
101
-
102
- /**
103
- * Set offsetSize.
104
- */
105
- setOffsetSize(offsetSize: number): void
106
-
107
- /**
108
- * Set default target origin.
109
- */
110
- setTargetOrigin(targetOrigin: string): void
111
-
112
- /**
113
- * Manually force iFrame to resize. To use passed arguments you need first to disable the `autoResize` option to
114
- * prevent auto resizing and enable the `sizeWidth` option if you wish to set the width.
115
- */
116
- resize(customHeight?: string, customWidth?: string): void
117
- }
118
-
119
- interface ParentProps {
120
- /**
121
- * The values returned by iframe.getBoundingClientRect()
122
- */
123
- iframe: {
124
- x: number
125
- y: number
126
- width: number
127
- height: number
128
- top: number
129
- right: number
130
- bottom: number
131
- left: number
132
- }
133
-
134
- /**
135
- * The values returned by document.documentElement.scrollWidth and document.documentElement.scrollHeight
136
- */
137
- document: {
138
- scrollWidth: number
139
- scrollHeight: number
140
- }
141
-
142
- /**
143
- * The values returned by window.visualViewport
144
- */
145
- viewport: {
146
- width: number
147
- height: number
148
- offsetLeft: number
149
- offsetTop: number
150
- pageLeft: number
151
- pageTop: number
152
- scale: number
153
- }
154
- }
155
- }
156
-
157
- global {
158
- interface Window {
159
- iFrameResizer: iframeResizer.IFramePageOptions
160
- parentIFrame: iframeResizer.IFramePage
161
- }
162
- }
163
-
164
- }