Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Add type to import Types #2537

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import Button from 'primevue/button';
import InputNumber from 'primevue/inputnumber';
import { computed, onMounted, ref, watch } from 'vue';
import { Code } from '@/types/Types';
import type { Code } from '@/types/Types';
import { CodeBlock, extractDynamicRows, getCodeBlocks } from '@/utils/code-asset';
import { cloneDeep, groupBy } from 'lodash';
import { AssetBlock } from '@/types/workflow';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ import {
} from '@/services/code';
import { useToastService } from '@/services/toast';
import { codeToAMR } from '@/services/knowledge';
import { AssetType, Code, CodeFile, ProgrammingLanguage } from '@/types/Types';
import type { Code, CodeFile } from '@/types/Types';
import { AssetType, ProgrammingLanguage } from '@/types/Types';
import TeraModal from '@/components/widgets/tera-modal.vue';
import InputText from 'primevue/inputtext';
import router from '@/router';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
import { computed, ref } from 'vue';
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import { CsvAsset } from '@/types/Types';
import type { CsvAsset } from '@/types/Types';
import MultiSelect from 'primevue/multiselect';
import Button from 'primevue/button';
import Chart from 'primevue/chart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
import { isEmpty } from 'lodash';
import { computed } from 'vue';
import TeraRelatedDocuments from '@/components/widgets/tera-related-documents.vue';
import { AssetType, CsvAsset, Dataset, DocumentAsset } from '@/types/Types';
import type { CsvAsset, Dataset, DocumentAsset } from '@/types/Types';
import { AssetType } from '@/types/Types';
import { AcceptedExtensions, FeatureConfig } from '@/types/common';
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ import InputText from 'primevue/inputtext';
// import { cloneDeep } from 'lodash';
import { useToastService } from '@/services/toast';
import { IModel } from '@jupyterlab/services/lib/session/session';
import { AssetType, CsvAsset, NotebookSession } from '@/types/Types';
import type { CsvAsset, NotebookSession } from '@/types/Types';
import { AssetType } from '@/types/Types';
import TeraJupyterChat from '@/components/llm/tera-jupyter-chat.vue';
import { IKernelConnection } from '@jupyterlab/services/lib/kernel/kernel';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script setup lang="ts">
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import { DatasetColumn } from '@/types/Types';
import type { DatasetColumn } from '@/types/Types';
import { computed } from 'vue';

const props = defineProps<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { ref, watch, onUpdated, Ref, PropType } from 'vue';
import * as textUtil from '@/utils/text';
import { cloneDeep, isString } from 'lodash';
import { downloadRawFile, getDataset, updateDataset } from '@/services/dataset';
import { CsvAsset, Dataset, DatasetColumn } from '@/types/Types';
import type { CsvAsset, Dataset, DatasetColumn } from '@/types/Types';
import TeraDatasetDatatable from '@/components/dataset/tera-dataset-datatable.vue';
import TeraAsset from '@/components/asset/tera-asset.vue';
import { FeatureConfig } from '@/types/common';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @fileoverview This file contains the utils for the tera-dataset components.
*/

import { Dataset } from '@/types/Types';
import type { Dataset } from '@/types/Types';

/**
* Enriches the dataset with additional information from the data-card.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<script setup lang="ts">
import { ref, watch } from 'vue';
import TeraPdfEmbed from '@/components/widgets/tera-pdf-embed.vue';
import { DocumentAsset, DocumentExtraction, ExtractionAssetType } from '@/types/Types';
import type { DocumentAsset, DocumentExtraction } from '@/types/Types';
import { ExtractionAssetType } from '@/types/Types';
import {
downloadDocumentAsset,
getDocumentAsset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ import { getRelatedArtifacts } from '@/services/provenance';
import TeraShowMoreText from '@/components/widgets/tera-show-more-text.vue';
import TeraImportGithubFile from '@/components/widgets/tera-import-github-file.vue';
import TeraPdfEmbed from '@/components/widgets/tera-pdf-embed.vue';
import { Model, Extraction, ProvenanceType, Document, Dataset } from '@/types/Types';
import type { Model, Extraction, Document, Dataset } from '@/types/Types';
import { ProvenanceType } from '@/types/Types';
import * as textUtil from '@/utils/text';
import Image from 'primevue/image';
import { generatePdfDownloadLink } from '@/services/generate-download-link';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</Accordion>
</template>
<script setup lang="ts">
import { DocumentAsset, DocumentExtraction } from '@/types/Types';
import type { DocumentAsset, DocumentExtraction } from '@/types/Types';
import { DocumentOperationState } from '@/workflow/ops/document/document-operation';
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

<script setup lang="ts">
import { computed, PropType } from 'vue';
import { AssetType, Document, ExternalPublication } from '@/types/Types';
import type { Document, ExternalPublication } from '@/types/Types';
import { AssetType } from '@/types/Types';
import { addDocuments } from '@/services/external';
import dropdown from 'primevue/dropdown';
import { useProjects } from '@/composables/project';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<script setup lang="ts">
import { getXDDArtifacts } from '@/services/data';
import { Document, Extraction } from '@/types/Types';
import type { Document, Extraction } from '@/types/Types';
import { XDDExtractionType } from '@/types/XDD';
import { getDocumentDoi } from '@/utils/data-util';
import Card from 'primevue/card';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { computed } from 'vue';
import { SessionContext } from '@jupyterlab/apputils';
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import { CsvAsset } from '@/types/Types';
import type { CsvAsset } from '@/types/Types';

const props = defineProps<{
jupyterSession: SessionContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import {
KernelState,
createMessageId
} from '@/services/jupyter';
import { AssetType, CsvAsset, NotebookSession } from '@/types/Types';
import type { CsvAsset, NotebookSession } from '@/types/Types';
import { AssetType } from '@/types/Types';
import TeraBeakerInput from '@/components/llm/tera-beaker-input.vue';
import TeraJupyterResponse from '@/components/llm/tera-jupyter-response.vue';
import { IModel } from '@jupyterlab/services/lib/session/session';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ import TeraJupyterResponseThought from '@/components/llm/tera-beaker-response-th
import Button from 'primevue/button';
import Menu from 'primevue/menu';
import { ref, computed, onMounted, watch } from 'vue';
import { CsvAsset } from '@/types/Types';
import type { CsvAsset } from '@/types/Types';
import TeraDatasetDatatable from '@/components/dataset/tera-dataset-datatable.vue';

const emit = defineEmits(['cell-updated', 'preview-selected', 'update-kernel-state']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import { cloneDeep } from 'lodash';
import { ref, computed, onMounted, onUnmounted } from 'vue';
import * as d3 from 'd3';
import { Position } from '@/types/workflow'; // temp
import { Model } from '@/types/Types';
import type { Model } from '@/types/Types';
import TeraInfiniteCanvas from '../widgets/tera-infinite-canvas.vue';
import TeraModelTemplate from './tera-model-template.vue';
import TeraCanvasItem from '../widgets/tera-canvas-item.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<script setup lang="ts">
import Button from 'primevue/button';
import InputText from 'primevue/inputtext';
import { ModelConfiguration } from '@/types/Types';
import type { ModelConfiguration } from '@/types/Types';

defineProps<{
editValue: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { StratifiedModel } from '@/model-representation/petrinet/petrinet-service';
import { ModelConfiguration } from '@/types/Types';
import type { ModelConfiguration } from '@/types/Types';
import Checkbox from 'primevue/checkbox';
import Button from 'primevue/button';
import TeraModal from '@/components/widgets/tera-modal.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import { ref, onMounted, computed, watch } from 'vue';
import { cloneDeep, isEmpty } from 'lodash';
import { StratifiedModel } from '@/model-representation/petrinet/petrinet-service';
import { generateMatrix } from '@/model-representation/petrinet/mira-petri';
import { Initial, ModelConfiguration, ModelParameter, Rate } from '@/types/Types';
import type { Initial, ModelConfiguration, ModelParameter, Rate } from '@/types/Types';
import InputText from 'primevue/inputtext';
import { pythonInstance } from '@/python/PyodideController';
import { StratifiedMatrix } from '@/types/Model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<script setup lang="ts">
import Button from 'primevue/button';
import InputText from 'primevue/inputtext';
import { ModelConfiguration } from '@/types/Types';
import type { ModelConfiguration } from '@/types/Types';

defineProps<{
editValue: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ import {
NodeType
} from '@/model-representation/petrinet/petrinet-renderer';
import { getGraphData, getPetrinetRenderer } from '@/model-representation/petrinet/petri-util';
import { Model, ModelConfiguration } from '@/types/Types';
import type { Model, ModelConfiguration } from '@/types/Types';
import TeraResizablePanel from '@/components/widgets/tera-resizable-panel.vue';
import { NestedPetrinetRenderer } from '@/model-representation/petrinet/nested-petrinet-renderer';
import { StratifiedMatrix } from '@/types/Model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<script setup lang="ts">
import { computed } from 'vue';
import { Model } from '@/types/Types';
import type { Model } from '@/types/Types';
import { useNodeTypeColorPalette } from '@/utils/petrinet-color-palette';

const props = defineProps<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ import {
StratifiedModel,
getStratificationType
} from '@/model-representation/petrinet/petrinet-service';
import { ModelConfiguration, Model } from '@/types/Types';
import type { ModelConfiguration, Model } from '@/types/Types';
import SplitButton from 'primevue/splitbutton';
import { getCatlabAMRPresentationData } from '@/model-representation/petrinet/catlab-petri';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ import { isEmpty } from 'lodash';
import { computed, ref } from 'vue';
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
import { AssetType, DocumentAsset, Model, Dataset, ModelConfiguration } from '@/types/Types';
import type { DocumentAsset, Model, Dataset, ModelConfiguration } from '@/types/Types';
import { AssetType } from '@/types/Types';
import { FeatureConfig, AcceptedExtensions, ResultType } from '@/types/common';
import * as textUtil from '@/utils/text';
import TeraRelatedDocuments from '@/components/widgets/tera-related-documents.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import { ref, watch } from 'vue';
import TeraMathEditor from '@/components/mathml/tera-math-editor.vue';
import TeraEquationContainer from '@/components/model/petrinet/tera-equation-container.vue';
import { Model } from '@/types/Types';
import type { Model } from '@/types/Types';
import { convertAMRToACSet, petriToLatex } from '@/model-representation/petrinet/petrinet-service';
import { equationsToAMR } from '@/services/knowledge';
import { cleanLatexEquations } from '@/utils/math';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { ref, computed, watch } from 'vue';
import TeraMathEditor from '@/components/mathml/tera-math-editor.vue';
import TeraEquationContainer from '@/components/model/petrinet/tera-equation-container.vue';
import { Model, Observable } from '@/types/Types';
import type { Model, Observable } from '@/types/Types';
import { extractVariablesFromMathML, EquationSide } from '@/utils/math';
import { cloneDeep, isEmpty } from 'lodash';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
</template>

<script setup lang="ts">
import { Model, ModelConfiguration } from '@/types/Types';
import type { Model, ModelConfiguration } from '@/types/Types';
import { cloneDeep, groupBy, isEmpty, round } from 'lodash';
import Accordion from 'primevue/accordion';
import AccordionTab from 'primevue/accordiontab';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ import InputText from 'primevue/inputtext';
// import { cloneDeep } from 'lodash';
import { useToastService } from '@/services/toast';
import { IModel } from '@jupyterlab/services/lib/session/session';
import { AssetType, CsvAsset, Model, NotebookSession } from '@/types/Types';
import type { CsvAsset, Model, NotebookSession } from '@/types/Types';
import { AssetType } from '@/types/Types';
import TeraJupyterChat from '@/components/llm/tera-jupyter-chat.vue';
import { IKernelConnection } from '@jupyterlab/services/lib/kernel/kernel';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import Menu from 'primevue/menu';
import { updateModelConfiguration, addDefaultConfiguration } from '@/services/model-configurations';
import { getModel, updateModel, getModelConfigurations, isModelEmpty } from '@/services/model';
import { FeatureConfig } from '@/types/common';
import { Model, ModelConfiguration } from '@/types/Types';
import type { Model, ModelConfiguration } from '@/types/Types';
import { useProjects } from '@/composables/project';

const props = defineProps({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ import DataTable, { DataTableRowSelectEvent } from 'primevue/datatable';
import Column from 'primevue/column';
import MultiSelect from 'primevue/multiselect';
import SelectButton from 'primevue/selectbutton';
import { PermissionGroup, PermissionUser } from '@/types/Types';
import type { PermissionGroup, PermissionUser } from '@/types/Types';
import {
getAllGroups,
getGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { watch, ref, computed } from 'vue';
import Button from 'primevue/button';
import { IProject } from '@/types/Project';
import { getUsers } from '@/services/user';
import { PermissionRelationships, PermissionUser } from '@/types/Types';
import type { PermissionRelationships, PermissionUser } from '@/types/Types';
import { useProjects } from '@/composables/project';
import TeraUserCard from './tera-user-card.vue';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Avatar from 'primevue/avatar';
import { computed, ref, watch } from 'vue';
import useAuthStore from '@/stores/auth';
import Dropdown, { DropdownChangeEvent } from 'primevue/dropdown';
import { PermissionUser } from '@/types/Types';
import type { PermissionUser } from '@/types/Types';

const props = defineProps<{ user: PermissionUser; permission?: string }>();
const emit = defineEmits(['select-permission']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ import Button from 'primevue/button';
import TeraModal from '@/components/widgets/tera-modal.vue';
import { isEmpty } from 'lodash';
import { getGithubCode, getGithubRepositoryContent } from '@/services/github-import';
import { DocumentAsset, AssetType, FileCategory, GithubFile, GithubRepo } from '@/types/Types';
import type { DocumentAsset, GithubFile, GithubRepo } from '@/types/Types';
import { AssetType, FileCategory } from '@/types/Types';
import { VAceEditor } from 'vue3-ace-editor';
import { VAceEditorInstance } from 'vue3-ace-editor/types';
import { getModeForPath } from 'ace-builds/src-noconflict/ext-modelist';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ import {
} from '@/services/knowledge';
import { PollerResult } from '@/api/api';
import { isEmpty } from 'lodash';
import { AssetType, DocumentAsset, ProvenanceType } from '@/types/Types';
import type { DocumentAsset } from '@/types/Types';
import { AssetType, ProvenanceType } from '@/types/Types';
import {
createProvenance,
getRelatedArtifacts,
Expand Down
7 changes: 4 additions & 3 deletions packages/client/hmi-client/src/composables/project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Use `activeProject` to get the active project in your component. It is read only and should not be directly modified.
/*
Use `activeProject` to get the active project in your component. It is read only and should not be directly modified.
`activeProject` can be refreshed by calling `getProject`
Use the functions in this composable to make modifications to the project and to add/remove assets from it.
Using these functions guarantees that such changes propogate to all components using `activeProject`.
Expand All @@ -9,7 +9,8 @@
import { IProject } from '@/types/Project';
import { computed, shallowRef } from 'vue';
import * as ProjectService from '@/services/project';
import { AssetType, PermissionRelationships } from '@/types/Types';
import type { PermissionRelationships } from '@/types/Types';
import { AssetType } from '@/types/Types';
import useAuthStore from '@/stores/auth';

const TIMEOUT_MS = 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Model, PetriNetTransition } from '@/types/Types';
import type { Model, PetriNetTransition } from '@/types/Types';

const MAX_DEPTH = 10;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { Model, PetriNetTransition } from '@/types/Types';
import type { Model, PetriNetTransition } from '@/types/Types';
import { createMatrix1D } from '@/utils/pivot';
import { StratifiedMatrix } from '@/types/Model';
import { createParameterMatrix, createTransitionMatrix } from './petri-matrix-service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Creates transition and parameter matrices for stratified models
import _ from 'lodash';
import { Model } from '@/types/Types';
import type { Model } from '@/types/Types';

export interface MatrixCell {
row: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
extractNestedStratas
} from '@/model-representation/petrinet/mira-petri';
import { createMatrix2D } from '@/utils/pivot';
import { Model } from '@/types/Types';
import type { Model } from '@/types/Types';

export const getPetrinetRenderer = (
model: Model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BasicRenderer, INode, IEdge } from '@graph-scaffolder/index';
import { D3SelectionINode, D3SelectionIEdge } from '@/services/graph';
import { pointOnPath } from '@/utils/svg';
import { useNodeTypeColorPalette } from '@/utils/petrinet-color-palette';
import { Model } from '@/types/Types';
import type { Model } from '@/types/Types';
import * as petrinetService from '@/model-representation/petrinet/petrinet-service';

export interface NodeData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import { useRoute } from 'vue-router';
import TeraPreviewPanel from '@/page/data-explorer/components/tera-preview-panel.vue';
import TeraFacetsPanel from '@/page/data-explorer/components/tera-facets-panel.vue';
import TeraSearchResultsList from '@/page/data-explorer/components/tera-search-results-list.vue';
import { XDDFacetsItemResponse } from '@/types/Types';
import type { XDDFacetsItemResponse } from '@/types/Types';
import TeraSearchbar from '@/components/navbar/tera-searchbar.vue';
import Chip from 'primevue/chip';
import { useSearchByExampleOptions } from './search-by-example';
Expand Down
Loading
Loading