Skip to content

Commit 3c29c31

Browse files
committed
fix: resolve type import problems
1 parent 4a9278a commit 3c29c31

6 files changed

Lines changed: 17 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"default": "./dist/utils/*.js"
4343
},
4444
"./styles/ember-drag-sort.css": "./dist/styles/ember-drag-sort.css",
45-
"./dist/_app_/*": "./dist/_app_/*.js"
45+
"./_app_/*": "./dist/_app_/*"
4646
},
4747
"files": [
4848
"addon-main.cjs",

rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
!process.env.SKIP_DECLARATIONS &&
5353
addon.declarations(
5454
'declarations',
55-
`pnpm tsc --declaration --project ${tsConfig}`,
55+
`pnpm ember-tsc --declaration --project ${tsConfig}`,
5656
),
5757

5858
// addons are allowed to contain imports of .css files, which we want rollup

src/components/drag-sort-item.gts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function getComputedStyleInt(element: HTMLElement, cssProp: string) {
1717
}
1818

1919
interface DragSortItemSignature<Item extends object> {
20+
Element: HTMLElement;
2021
Args: {
2122
additionalArgs?: object;
2223
determineForeignPositionAction?: unknown;
@@ -27,14 +28,18 @@ interface DragSortItemSignature<Item extends object> {
2728
element: HTMLElement;
2829
draggedItem: Item;
2930
}) => void;
30-
group: string;
31+
group?: string;
3132
handle?: string;
3233
index: number;
33-
isHorizontal: boolean;
34+
isHorizontal?: boolean;
3435
isRtl?: boolean;
3536
item: Item;
3637
items: Array<Item>;
3738
sourceOnly: boolean;
39+
tagName?: string;
40+
};
41+
Blocks: {
42+
default: [];
3843
};
3944
}
4045

src/components/drag-sort-list.gts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ interface DragSortListSignature<Item extends object> {
1919
}) => number;
2020
draggingEnabled?: boolean;
2121
dragEndAction?: unknown;
22-
dragStartAction?: unknown;
22+
dragStartAction?: (args: {
23+
event: DragEvent;
24+
element: HTMLElement;
25+
draggedItem: Item;
26+
}) => void;
2327
handle?: string;
2428
items: Array<Item>;
2529
isHorizontal?: boolean;
2630
isRtl?: boolean;
2731
group?: string;
2832
sourceOnly?: boolean;
33+
tagName?: string;
2934
};
3035
Blocks: {
3136
default: [item: Item, index: number];
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Public API
21
export { default as DragSortList } from './components/drag-sort-list.gts';
32
export { default as DragSortItem } from './components/drag-sort-item.gts';
43
export { default as DragSortService } from './services/drag-sort.ts';

src/services/drag-sort.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export default class DragSort<Item extends object> extends Service {
5252
item: Item;
5353
index: number;
5454
items: Array<Item>;
55-
group: string;
56-
isHorizontal: boolean;
55+
group?: string;
56+
isHorizontal?: boolean;
5757
}) {
5858
setProperties(this, {
5959
isDragging: true,

0 commit comments

Comments
 (0)