@react-types/shared
Advanced tools
Comparing version 3.23.1 to 3.24.0
{ | ||
"name": "@react-types/shared", | ||
"version": "3.23.1", | ||
"version": "3.24.0", | ||
"description": "Spectrum UI components in React", | ||
@@ -12,3 +12,3 @@ "license": "Apache-2.0", | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
}, | ||
@@ -18,3 +18,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433" | ||
"gitHead": "86d80e3216bc32e75108831cf3a5a720bc849206" | ||
} |
@@ -126,2 +126,24 @@ /* | ||
export interface Rect { | ||
x: number, | ||
y: number, | ||
width: number, | ||
height: number | ||
} | ||
export interface Size { | ||
width: number, | ||
height: number | ||
} | ||
/** A LayoutDelegate provides layout information for collection items. */ | ||
export interface LayoutDelegate { | ||
/** Returns a rectangle for the item with the given key. */ | ||
getItemRect(key: Key): Rect | null, | ||
/** Returns the visible rectangle of the collection. */ | ||
getVisibleRect(): Rect, | ||
/** Returns the size of the scrollable content in the collection. */ | ||
getContentSize(): Size | ||
} | ||
/** | ||
@@ -198,3 +220,5 @@ * A generic interface to access a readonly sequential | ||
/** @private */ | ||
shouldInvalidate?: (context: unknown) => boolean | ||
shouldInvalidate?: (context: unknown) => boolean, | ||
/** A function that renders this node to a React Element in the DOM. */ | ||
render?: (node: Node<any>) => ReactElement | ||
} |
@@ -13,4 +13,3 @@ /* | ||
import {Key} from '@react-types/shared'; | ||
import {RefObject} from 'react'; | ||
import {Key, RefObject} from '@react-types/shared'; | ||
@@ -285,5 +284,5 @@ export interface DragDropEvent { | ||
/** The ref of the element that will be rendered as the drag preview while dragging. */ | ||
preview?: RefObject<DragPreviewRenderer>, | ||
preview?: RefObject<DragPreviewRenderer | null>, | ||
/** Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed. */ | ||
getAllowedDropOperations?: () => DropOperation[] | ||
} |
@@ -48,2 +48,6 @@ /* | ||
altKey: boolean, | ||
/** X position relative to the target. */ | ||
x: number, | ||
/** Y position relative to the target. */ | ||
y: number, | ||
/** | ||
@@ -50,0 +54,0 @@ * By default, press events stop propagation to parent elements. |
@@ -13,3 +13,3 @@ /* | ||
import {Ref} from 'react'; | ||
import {ReactNode, Ref, RefAttributes} from 'react'; | ||
@@ -26,1 +26,12 @@ export interface DOMRefValue<T extends HTMLElement = HTMLElement> { | ||
export type FocusableRef<T extends HTMLElement = HTMLElement> = Ref<FocusableRefValue<T>>; | ||
export interface RefObject<T> { | ||
current: T | ||
} | ||
// Override forwardRef types so generics work. | ||
declare function forwardRef<T, P = {}>( | ||
render: (props: P, ref: Ref<T>) => ReactNode | null | ||
): (props: P & RefAttributes<T>) => ReactNode | null; | ||
export type forwardRefType = typeof forwardRef; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86204
1803