use typed imports

This commit is contained in:
Hayden 2024-03-01 11:21:45 -06:00
parent 5440fc60e1
commit 26b17e5cf8
No known key found for this signature in database
GPG key ID: 17CF79474E257545
54 changed files with 80 additions and 77 deletions

View file

@ -2,7 +2,7 @@ import { faker } from "@faker-js/faker";
import { expect } from "vitest";
import { overrideParts } from "../../base/urls";
import { PublicApi } from "../../public";
import { ItemField, LabelCreate, LocationCreate, UserRegistration } from "../../types/data-contracts";
import type { ItemField, LabelCreate, LocationCreate, UserRegistration } from "../../types/data-contracts";
import * as config from "../../../../test/config";
import { UserClient } from "../../user";
import { Requests } from "../../../requests";

View file

@ -1,6 +1,6 @@
import { beforeAll, expect } from "vitest";
import { faker } from "@faker-js/faker";
import { UserClient } from "../user";
import type { UserClient } from "../user";
import { factories } from "./factories";
const cache = {

View file

@ -1,8 +1,8 @@
import { faker } from "@faker-js/faker";
import { describe, test, expect } from "vitest";
import { ItemField, ItemUpdate, LocationOut } from "../../types/data-contracts";
import type { ItemField, ItemUpdate, LocationOut } from "../../types/data-contracts";
import { AttachmentTypes } from "../../types/non-generated";
import { UserClient } from "../../user";
import type { UserClient } from "../../user";
import { factories } from "../factories";
import { sharedUserClient } from "../test-utils";

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { LabelOut } from "../../types/data-contracts";
import { UserClient } from "../../user";
import type { LabelOut } from "../../types/data-contracts";
import type { UserClient } from "../../user";
import { factories } from "../factories";
import { sharedUserClient } from "../test-utils";

View file

@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { LocationOut } from "../../types/data-contracts";
import { UserClient } from "../../user";
import type { LocationOut } from "../../types/data-contracts";
import type { UserClient } from "../../user";
import { factories } from "../factories";
import { sharedUserClient } from "../test-utils";

View file

@ -1,6 +1,6 @@
import { faker } from "@faker-js/faker";
import { beforeAll, describe, expect, test } from "vitest";
import { UserClient } from "../../user";
import type { UserClient } from "../../user";
import { factories } from "../factories";
type ImportObj = {

View file

@ -1,4 +1,4 @@
import { Requests } from "../../requests";
import type { Requests } from "../../requests";
import { route } from ".";
const ZERO_DATE = "0001-01-01T00:00:00Z";

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "../base";
import { ActionAmountResult } from "../types/data-contracts";
import type { ActionAmountResult } from "../types/data-contracts";
export class ActionsAPI extends BaseAPI {
ensureAssetIDs() {

View file

@ -1,6 +1,6 @@
import { BaseAPI, route } from "../base";
import { ItemSummary } from "../types/data-contracts";
import { PaginationResult } from "../types/non-generated";
import type { ItemSummary } from "../types/data-contracts";
import type { PaginationResult } from "../types/non-generated";
export class AssetsApi extends BaseAPI {
async get(id: string, page = 1, pageSize = 50) {

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "../base";
import {
import type {
CurrenciesCurrency,
Group,
GroupInvitation,

View file

@ -1,6 +1,6 @@
import { BaseAPI, route } from "../base";
import { parseDate } from "../base/base-api";
import {
import type {
ItemAttachmentUpdate,
ItemCreate,
ItemOut,
@ -13,8 +13,8 @@ import {
MaintenanceEntryUpdate,
MaintenanceLog,
} from "../types/data-contracts";
import { AttachmentTypes, PaginationResult } from "../types/non-generated";
import { Requests } from "~~/lib/requests";
import type { AttachmentTypes, PaginationResult } from "../types/non-generated";
import type { Requests } from "~~/lib/requests";
export type ItemsQuery = {
orderBy?: string;

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "../base";
import { LabelCreate, LabelOut } from "../types/data-contracts";
import type { LabelCreate, LabelOut } from "../types/data-contracts";
export class LabelsApi extends BaseAPI {
getAll() {

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "../base";
import { LocationOutCount, LocationCreate, LocationOut, LocationUpdate, TreeItem } from "../types/data-contracts";
import type { LocationOutCount, LocationCreate, LocationOut, LocationUpdate, TreeItem } from "../types/data-contracts";
export type LocationsQuery = {
filterChildren: boolean;

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "../base";
import { NotifierCreate, NotifierOut, NotifierUpdate } from "../types/data-contracts";
import type { NotifierCreate, NotifierOut, NotifierUpdate } from "../types/data-contracts";
export class NotifiersAPI extends BaseAPI {
getAll() {

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "../base";
import { GroupStatistics, TotalsByOrganizer, ValueOverTime } from "../types/data-contracts";
import type { GroupStatistics, TotalsByOrganizer, ValueOverTime } from "../types/data-contracts";
function YYYY_MM_DD(date?: Date): string {
if (!date) {

View file

@ -1,6 +1,6 @@
import { BaseAPI, route } from "../base";
import { ChangePassword, UserOut } from "../types/data-contracts";
import { Result } from "../types/non-generated";
import type { ChangePassword, UserOut } from "../types/data-contracts";
import type { Result } from "../types/non-generated";
export class UserApi extends BaseAPI {
public self() {

View file

@ -1,5 +1,5 @@
import { BaseAPI, route } from "./base";
import { APISummary, LoginForm, TokenResponse, UserRegistration } from "./types/data-contracts";
import type { APISummary, LoginForm, TokenResponse, UserRegistration } from "./types/data-contracts";
export type StatusResult = {
health: boolean;

View file

@ -9,7 +9,7 @@ import { StatsAPI } from "./classes/stats";
import { AssetsApi } from "./classes/assets";
import { ReportsAPI } from "./classes/reports";
import { NotifiersAPI } from "./classes/notifiers";
import { Requests } from "~~/lib/requests";
import type { Requests } from "~~/lib/requests";
export class UserClient extends BaseAPI {
locations: LocationsApi;