Skip to content

Commit

Permalink
Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Feb 24, 2022
1 parent f691305 commit 159f334
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
5 changes: 2 additions & 3 deletions scripts/classes/ProcessInputForm/classProcessInputForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import classShowHideElements from "./classShowHideElements";
import classErrorHandler from "../ErrorHandler/classErrorHandler";

// Type definition imports
import { TStatensVegvesenBilData } from "../../types/typeDefinitions";
import { IStatensVegvesenBilData } from "../../types/typeDefinitions";

/**
* Class responsible for fetching the remote data
* @property {TStatensVegvesenBilData} remoteBilData Remote data from API
*/
export default class classProcessInputForm {
//private static remoteBilData: TStatensVegvesenBilData;
private static remoteBilData: any;
private static remoteBilData: IStatensVegvesenBilData;

/**
* Send the form, show the loading spinner and fetch remote data
Expand Down
17 changes: 8 additions & 9 deletions scripts/types/typeDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
* Type definition for data returned from API.
* Returns an object with strings.
*/
export type TStatensVegvesenBilData = {

export interface IStatensVegvesenBilData {
// Will return error message if the car was not found
melding: string;
/**
* Registration number for personalised number plate)
* @see https://www.vegvesen.no/en/vehicles/own-and-maintain/number-plates/personalised-number-plates
*/
kjennemerke: string;
registrering: {
// Details about when car was registered for the first time
forstegangsregistrering: string;
// Details about when car was registered on owner
forstegangsregistreringEier: string;
};
// Details about when car was registered for the first time
forstegangsregistrering: string;
// Details about when car was registered on owner
forstegangsregistreringEier: string;
// Last time the car had a mandatory roadworthiness test
periodiskKjoretoykontroll: { sistKontrollert: string };
};
sistKontrollert: string;
}

0 comments on commit 159f334

Please sign in to comment.