@micromag/core 0.4.69 → 0.4.74

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/es/hooks.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import * as _react_spring_core from '@react-spring/core';
3
3
  import * as _use_gesture_react_dist_declarations_src_types from '@use-gesture/react/dist/declarations/src/types';
4
+ export { useIntersectionObserver, useResizeObserver } from '@folklore/hooks';
4
5
 
5
- declare function useActivityDetector({ element: providedElement, disabled, timeout: timeoutDelay }?: {
6
- element?: any;
6
+ declare function useActivityDetector({ disabled, timeout: timeoutDelay }?: {
7
7
  disabled?: boolean;
8
8
  timeout?: number;
9
9
  }): {
@@ -43,10 +43,10 @@ declare function useDragProgress({ progress: wantedProgress, onTap, disabled, dr
43
43
  direction: number;
44
44
  };
45
45
 
46
- declare const useForm: ({ fields: providedFields, injectInFields, ...opts }?: {
46
+ declare function useForm({ fields: providedFields, injectInFields, ...opts }?: {
47
47
  fields?: any[];
48
48
  injectInFields?: boolean;
49
- }) => {
49
+ }): {
50
50
  fields: any[];
51
51
  status: any;
52
52
  response: unknown;
@@ -77,7 +77,8 @@ declare const useFormTransition: (initialPaths?: any, initialStyles?: {}) => {
77
77
  timeout: number;
78
78
  };
79
79
 
80
- declare const useFullscreen: (element: any) => {
80
+ declare const useFullscreen: () => {
81
+ ref: react.RefObject<any>;
81
82
  toggle: () => void;
82
83
  fullscreen: () => void;
83
84
  unFullscreen: () => void;
@@ -85,12 +86,14 @@ declare const useFullscreen: (element: any) => {
85
86
  enabled: any;
86
87
  };
87
88
 
88
- declare const useIsVisible: ({ rootMargin, persist, disabled }?: {
89
+ interface UseIsVisibleOptions {
90
+ rootMargin?: string;
89
91
  persist?: boolean;
90
92
  disabled?: boolean;
91
- }) => {
92
- ref: react.RefObject<any>;
93
- visible: any;
93
+ }
94
+ declare const useIsVisible: ({ rootMargin, persist, disabled, }?: UseIsVisibleOptions) => {
95
+ ref: react.RefObject<HTMLElement>;
96
+ visible: boolean;
94
97
  };
95
98
 
96
99
  declare const useLoadedFonts: (fonts: any) => {
@@ -118,60 +121,31 @@ declare const useLongPress: ({ onLongPress, onLongPressStart, onLongPressEnd, on
118
121
  triggered: boolean;
119
122
  };
120
123
 
121
- declare const useMediaApi: ({ url, onTimeUpdate, onProgressStep, onDurationChange, onVolumeChange, onPlay, onPause, onEnded, onSeeked, onSuspend, onLoadStart, onCanPlayThough, onCanPlay, onLoadedData, onLoadedMetadata, }?: {
122
- url?: any;
123
- onTimeUpdate?: any;
124
- onProgressStep?: any;
125
- onDurationChange?: any;
126
- onVolumeChange?: any;
127
- onPlay?: any;
128
- onPause?: any;
129
- onEnded?: any;
130
- onSeeked?: any;
131
- onSuspend?: any;
132
- onLoadStart?: any;
133
- onCanPlayThough?: any;
134
- onCanPlay?: any;
135
- onLoadedData?: any;
136
- onLoadedMetadata?: any;
137
- }) => {
138
- ref: react.RefObject<any>;
139
- play: () => void;
140
- pause: () => void;
141
- stop: () => void;
142
- seek: (time: any) => void;
143
- currentTime: any;
144
- duration: any;
145
- playing: boolean;
146
- paused: boolean;
147
- ready: boolean;
148
- dataReady: boolean;
149
- suspended: boolean;
150
- };
124
+ type MediaElement = HTMLVideoElement | HTMLAudioElement | HTMLMediaElement;
151
125
 
152
- declare const useMediaBuffering: (mediaElement?: any, interval?: number) => {
126
+ declare const useMediaBuffering: (media?: MediaElement | null) => {
153
127
  buffering: boolean;
154
128
  };
155
129
 
156
- declare const useMediaState: (mediaElement?: HTMLMediaElement | null, { playing: wantedPlaying, muted: wantedMuted }?: {
130
+ declare function useMediaState(media?: MediaElement | null, { playing: wantedPlaying, muted: wantedMuted }?: {
157
131
  playing?: boolean;
158
132
  muted?: boolean;
159
- }) => {
133
+ }): {
160
134
  playing: boolean;
161
135
  muted: boolean;
162
136
  buffering: boolean;
163
137
  };
164
138
 
165
- declare function useMediaCurrentTime(element: any, { id, disabled, updateInterval, onUpdate: customOnUpdate }?: {
139
+ declare function useMediaCurrentTime(media: MediaElement | null, { id, disabled, updateInterval, onUpdate: customOnUpdate }?: {
166
140
  id?: any;
167
141
  disabled?: boolean;
168
142
  updateInterval?: number;
169
143
  onUpdate?: any;
170
144
  }): number;
171
145
 
172
- declare function useMediaDuration(element: any, { id }?: {
146
+ declare function useMediaDuration(media: MediaElement | null, { id }?: {
173
147
  id?: any;
174
- }): any;
148
+ }): number;
175
149
 
176
150
  declare function useMediaLoad(element: any, { preload, shouldLoad }?: {
177
151
  preload?: string;
@@ -180,7 +154,7 @@ declare function useMediaLoad(element: any, { preload, shouldLoad }?: {
180
154
 
181
155
  declare function useMediaProgress(media?: any, options?: any): number;
182
156
 
183
- declare function useMediaReady(element: HTMLMediaElement | null, { id }?: {
157
+ declare function useMediaReady(media: MediaElement | null, { id }?: {
184
158
  id?: string | null;
185
159
  }): boolean;
186
160
 
@@ -221,36 +195,16 @@ declare const useMediasParser: () => {
221
195
  parser: MediasParser;
222
196
  };
223
197
 
224
- declare function useMediaThumbnail(media: any, file?: any): any;
225
-
226
198
  declare function useMediaWaveform(media: any, { fake, reduceBufferFactor }?: {
227
199
  fake?: boolean;
228
200
  reduceBufferFactor?: number;
229
201
  }): any;
230
202
 
231
- declare const getObserver: (Observer: any, options?: {}) => any;
232
- declare const useObserver: (Observer: any, opts?: any, initialEntry?: any) => {
233
- ref: react.RefObject<any>;
234
- entry: any;
235
- };
236
- declare const useIntersectionObserver: ({ root, rootMargin, threshold, disabled, }?: {
237
- root?: any;
238
- rootMargin?: string;
239
- threshold?: number[];
240
- disabled?: boolean;
241
- }) => {
242
- ref: react.RefObject<any>;
243
- entry: any;
244
- };
245
- declare const useResizeObserver: (options?: any) => {
246
- ref: react.RefObject<any>;
247
- entry: any;
248
- };
249
- declare const useDimensionObserver: (...args: any[]) => {
250
- entry: any;
203
+ declare function useDimensionObserver(opts?: {}): {
204
+ entry: ResizeObserverEntry;
251
205
  width: any;
252
206
  height: any;
253
- ref: react.RefObject<any>;
207
+ ref: react.RefObject<HTMLElement>;
254
208
  };
255
209
 
256
210
  declare const useParsedStory: (story: any, { disabled, withTheme, withMedias, withFonts, withMigrations, }?: {
@@ -270,15 +224,17 @@ declare function usePlaceholderStyle(selector: string, placeholderStyle: {
270
224
  textAlign?: string | null;
271
225
  }): string | null;
272
226
 
273
- declare function useProgressSteps({ disabled, currentTime, duration, onStep, steps, }?: {
227
+ declare function useProgressSteps({ disabled, currentTime, duration, onStep, steps, }: {
274
228
  disabled?: boolean;
229
+ currentTime: any;
230
+ duration: any;
275
231
  onStep?: any;
276
232
  steps?: number[];
277
233
  }): void;
278
234
 
279
235
  declare const useDevicePixelRatio: () => number;
280
236
  declare const useScreenSizeFromElement: (options?: any) => {
281
- ref: react.RefObject<any>;
237
+ ref: react.RefObject<HTMLElement>;
282
238
  fullWidth: any;
283
239
  fullHeight: any;
284
240
  screenSize: {
@@ -336,10 +292,10 @@ declare const useThemeParser: () => (story: any) => any;
336
292
 
337
293
  declare const useTrackScreenView: () => (screen?: any, index?: any) => void;
338
294
  declare const useTrackScreenEvent: (type?: any) => (action?: any, label?: any, opts?: any) => void;
339
- declare const useTrackScreenMedia: (type?: any) => (media?: any, action?: any, opts?: any) => void;
295
+ declare const useTrackScreenMedia: (type?: string | null) => (media?: any, action?: any, opts?: any) => void;
340
296
  declare const useTrackEvent: () => (category?: any, action?: any, label?: any, opts?: any) => void;
341
297
  declare const useTrackMedia: (type?: any) => (media?: any, action?: any, opts?: any) => void;
342
298
 
343
299
  declare const useWindowEvent: (event: any, callback: any, enabled?: boolean) => void;
344
300
 
345
- export { getObserver, useActivityDetector, useAnimationFrame, useDebounced as useDebounce, useDevicePixelRatio, useDimensionObserver, useDocumentEvent, useDragProgress, useForm, useFormTransition, useFormattedDate, useFormattedTime, useFullscreen, useIntersectionObserver, useIsVisible, useLoadedFonts, useLongPress, useMediaApi, useMediaBuffering, useMediaCurrentTime, useMediaDuration, useMediaLoad, useMediaProgress, useMediaReady, useMediaState, useMediaThumbnail, useMediaTimestampOffset, useMediaWaveform, useMediasParser, useObserver, useParsedStory, usePlaceholderStyle, useProgressSteps, useResizeObserver, useScreenSizeFromElement, useScreenSizeFromWindow, useSpringValue, useSupportsWebp, useSwipe, useThemeParser, useTrackEvent, useTrackMedia, useTrackScreenEvent, useTrackScreenMedia, useTrackScreenView, useWindowEvent };
301
+ export { useActivityDetector, useAnimationFrame, useDebounced as useDebounce, useDevicePixelRatio, useDimensionObserver, useDocumentEvent, useDragProgress, useForm, useFormTransition, useFormattedDate, useFormattedTime, useFullscreen, useIsVisible, useLoadedFonts, useLongPress, useMediaBuffering, useMediaCurrentTime, useMediaDuration, useMediaLoad, useMediaProgress, useMediaReady, useMediaState, useMediaTimestampOffset, useMediaWaveform, useMediasParser, useParsedStory, usePlaceholderStyle, useProgressSteps, useScreenSizeFromElement, useScreenSizeFromWindow, useSpringValue, useSupportsWebp, useSwipe, useThemeParser, useTrackEvent, useTrackMedia, useTrackScreenEvent, useTrackScreenMedia, useTrackScreenView, useWindowEvent };