floating-ui / floating-ui

A JavaScript library to position floating elements and create interactions for them.
https://floating-ui.com
MIT License
30.16k stars 1.61k forks source link

Typescript errors #1474

Closed GroofyIT closed 2 years ago

GroofyIT commented 2 years ago

dom @ 0.1.8 core @ 0.2.2

Experiencing following typescript errors :

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/computePosition.d.ts:1:13 '=' expected.

  L1:  import type { ComputePosition } from './types';
  L2:  export declare const computePosition: ComputePosition;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/computePosition.d.ts:1:38 ';' expected.

  L1:  import type { ComputePosition } from './types';
  L2:  export declare const computePosition: ComputePosition;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:13 '=' expected.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:103 ';' expected.

  L1:  ort type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './types';
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/arrow.d.ts:1:13 '=' expected.

  L1:  import type { Middleware, Padding } from '../types';
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/arrow.d.ts:1:42 ';' expected.

  L1:  import type { Middleware, Padding } from '../types';
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts:1:13 '=' expected.

  L1:  import type { Middleware, Placement, Alignment } from '../types';
  L2:  import { Options as DetectOverflowOptions } from '../detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts:1:55 ';' expected.

  L1:  import type { Middleware, Placement, Alignment } from '../types';
  L2:  import { Options as DetectOverflowOptions } from '../detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/flip.d.ts:1:13 '=' expected.

  L1:  import type { Placement, Middleware } from '../types';
  L2:  import { Options as DetectOverflowOptions } from '../detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/flip.d.ts:1:44 ';' expected.

  L1:  import type { Placement, Middleware } from '../types';
  L2:  import { Options as DetectOverflowOptions } from '../detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/hide.d.ts:1:13 '=' expected.

  L1:  import type { Middleware } from '../types';
  L2:  export declare const hide: () => Middleware;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/hide.d.ts:1:33 ';' expected.

  L1:  import type { Middleware } from '../types';
  L2:  export declare const hide: () => Middleware;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/offset.d.ts:1:13 '=' expected.

  L1:  import type { Placement, Rect, Coords, Middleware } from '../types';
  L2:  declare type OffsetValue = number | {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/offset.d.ts:1:58 ';' expected.

  L1:  import type { Placement, Rect, Coords, Middleware } from '../types';
  L2:  declare type OffsetValue = number | {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/shift.d.ts:1:13 '=' expected.

  L1:  import type { Middleware, Rect, Placement, MiddlewareArguments, Coords } from '../types';
  L2:  import { Options as DetectOverflowOptions } from '../detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/shift.d.ts:1:79 ';' expected.

  L1:  import type { Middleware, Rect, Placement, MiddlewareArguments, Coords } from '../types';
  L2:  import { Options as DetectOverflowOptions } from '../detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/dom/src/types.d.ts:1:13 '=' expected.

  L1:  import type { Middleware, MiddlewareArguments, SideObject } from '@floating-ui/core';
  L2:  import type { Options as DetectOverflowOptions } from '@floating-ui/core/src/detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/dom/src/types.d.ts:1:66 ';' expected.

  L1:  import type { Middleware, MiddlewareArguments, SideObject } from '@floating-ui/core';
  L2:  import type { Options as DetectOverflowOptions } from '@floating-ui/core/src/detectOverflow';

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/computePosition.d.ts:1:15 Cannot find name 'ComputePosition'. Did you mean 'computePosition'?

  L1:  import type { ComputePosition } from './types';
  L2:  export declare const computePosition: ComputePosition;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/computePosition.d.ts:1:33 Cannot find name 'from'.

  L1:  import type { ComputePosition } from './types';
  L2:  export declare const computePosition: ComputePosition;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/computePosition.d.ts:2:39 Cannot find name 'ComputePosition'.

  L1:  import type { ComputePosition } from './types';
  L2:  export declare const computePosition: ComputePosition;

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:15 Cannot find name 'SideObject'.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:15 Left side of comma operator is unused and has no side effects.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:27 Cannot find name 'Padding'.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:36 Cannot find name 'Boundary'.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:46 Cannot find name 'RootBoundary'.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:60 Cannot find name 'ElementContext'.

  L1:  import type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './type
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:76 Cannot find name 'MiddlewareArguments'.

  L1:  ort type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './types';
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/detectOverflow.d.ts:1:98 Cannot find name 'from'.

  L1:  ort type { SideObject, Padding, Boundary, RootBoundary, ElementContext, MiddlewareArguments } from './types';
  L2:  export declare type Options = {

[ ERROR ] TypeScript: node_modules/@floating-ui/core/src/middleware/arrow.d.ts:1:15 Cannot find name 'Middleware'.

  L1:  import type { Middleware, Padding } from '../types';
  L2:  export declare type Options = {
atomiks commented 2 years ago

Are you on the latest TS version?

GroofyIT commented 2 years ago

The project is a StencilJS project (older version) which seems to use typescript@3.5.2 internally rather than the project wide defined 4.5 version.

atomiks commented 2 years ago

I think you need to upgrade to at least typescript@3.8.0 (when type keyword for imports got introduced), so you could upgrade StencilJS or maybe force the resolution of a newer TS version. Not much this library can do though.