Skip to content

Commit

Permalink
add type alias for used dayjs types to further reduce dependency from…
Browse files Browse the repository at this point in the history
… dayjs
  • Loading branch information
TIL-EBP committed Sep 19, 2024
1 parent 698fd3c commit 5a3b8e7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
import {TimeExtent} from '../../interfaces/time-extent.interface';
import {TimeSliderConfiguration, TimeSliderLayerSource} from '../../../shared/interfaces/topic.interface';
import {ManipulateType, UnitType} from 'dayjs';
import {ManipulateTypeAlias as ManipulateType, UnitTypeAlias as UnitType} from '../../../shared/types/dayjs-alias-type';
import {TimeSliderService} from '../../services/time-slider.service';
import {TimeExtentUtils} from '../../../shared/utils/time-extent.utils';
import {MatDatepicker} from '@angular/material/datepicker';
Expand Down
4 changes: 4 additions & 0 deletions src/app/shared/types/dayjs-alias-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {ManipulateType, UnitType} from 'dayjs';

export type ManipulateTypeAlias = ManipulateType;
export type UnitTypeAlias = UnitType;
3 changes: 2 additions & 1 deletion src/app/shared/utils/dayjs.utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dayjs, {ManipulateType, UnitType} from 'dayjs';
import dayjs from 'dayjs';
import {ManipulateTypeAlias as ManipulateType, UnitTypeAlias as UnitType} from '../types/dayjs-alias-type';
import duration, {Duration} from 'dayjs/plugin/duration';
import utc from 'dayjs/plugin/utc';
import customParseFormat from 'dayjs/plugin/customParseFormat';
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/utils/time-extent.utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Duration} from 'dayjs/plugin/duration';
import {ManipulateType} from 'dayjs';
import {ManipulateTypeAlias as ManipulateType} from '../types/dayjs-alias-type';
import {TimeSliderConfiguration} from '../interfaces/topic.interface';
import {TimeExtent} from '../../map/interfaces/time-extent.interface';
import {DayjsUtils} from './dayjs.utils';
Expand Down

0 comments on commit 5a3b8e7

Please sign in to comment.