Skip to content

Commit

Permalink
define type for lu sections
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixzhan committed Dec 18, 2020
1 parent 7a1041e commit d9d62f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Composer/packages/lib/indexers/src/utils/luUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
Range,
DiagnosticSeverity,
ILUFeaturesConfig,
LuParseResource,
} from '@bfc/shared';
import formatMessage from 'format-message';

Expand Down Expand Up @@ -63,7 +64,11 @@ export function convertLuDiagnostic(d: any, source: string, offset = 0): Diagnos
return result;
}

export function convertLuParseResultToLuFile(id: string, resource, luFeatures: ILUFeaturesConfig): LuFile {
export function convertLuParseResultToLuFile(
id: string,
resource: LuParseResource,
luFeatures: ILUFeaturesConfig
): LuFile {
// filter structured-object from LUParser result.
const { Sections, Errors, Content } = resource;
const intents: LuIntentSection[] = [];
Expand Down
15 changes: 14 additions & 1 deletion Composer/packages/types/src/indexers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,21 @@ export type LuFile = {
[key: string]: any;
};

export type LuParseResourceSection = {
Name: string;
Body: string;
SectionType: string;
Path: string;
Id: string;
Description: string;
Answer: string;
Questions: string[];
ModelInfo: string;
[key: string]: any;
};

export type LuParseResource = {
Sections: any[];
Sections: LuParseResourceSection[];
Errors: any[];
Content: string;
};
Expand Down

0 comments on commit d9d62f0

Please sign in to comment.