diff --git a/packages/@react-types/shared/src/collections.d.ts b/packages/@react-types/shared/src/collections.d.ts index 69a53116c3a..60c98d76038 100644 --- a/packages/@react-types/shared/src/collections.d.ts +++ b/packages/@react-types/shared/src/collections.d.ts @@ -10,9 +10,10 @@ * governing permissions and limitations under the License. */ -import {Key} from '@react-types/shared'; +import {Key} from './key'; import {LinkDOMProps} from './dom'; import {ReactElement, ReactNode} from 'react'; +import {Rect, Size} from './layout'; export interface ItemProps extends LinkDOMProps { /** Rendered contents of the item or child items. */ @@ -132,18 +133,6 @@ export interface KeyboardDelegate { getKeyForSearch?(search: string, fromKey?: Key | null): Key | null; } -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. */ diff --git a/packages/@react-types/shared/src/index.d.ts b/packages/@react-types/shared/src/index.d.ts index a03f171f718..79dc9a287e1 100644 --- a/packages/@react-types/shared/src/index.d.ts +++ b/packages/@react-types/shared/src/index.d.ts @@ -24,3 +24,4 @@ export * from './labelable'; export * from './orientation'; export * from './locale'; export * from './key'; +export * from './layout'; diff --git a/packages/@react-types/shared/src/layout.d.ts b/packages/@react-types/shared/src/layout.d.ts new file mode 100644 index 00000000000..335b4c7222a --- /dev/null +++ b/packages/@react-types/shared/src/layout.d.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2026 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ + +export interface Point { + x: number; + y: number; +} + +export interface Rect { + x: number; + y: number; + width: number; + height: number; +} + +export interface Size { + width: number; + height: number; +}