Help us understand the problem. What is going on with this article?

Power Apps component framework で使用できる CDS データ型と、対応する JavaScript/TypeScript の型

目的

CDS の TwoOptions などのフィールドタイプに対応する JS/TS の型をまとめたかった。

Power App component framework で使用できる CDS データ型

https://docs.microsoft.com/ja-jp/powerapps/developer/component-framework/manifest-schema-reference/property

マニフェスト定義と生成される JS/TS データ型

前提

$ npm list --depth=0
pcf-project@1.0.0 C:\Users\...
+-- @types/node@10.17.6
+-- @types/powerapps-component-framework@1.2.1
+-- pcf-scripts@1.0.6
`-- pcf-start@1.0.6

挙動

ControlManifest.Input.xml
...
    <property name="newAttr1"  display-name-key="newAttr1_Display_Key"  description-key="newAttr1_Desc_Key"  of-type="Currency"                 usage="bound" required="true" />
    <property name="newAttr2"  display-name-key="newAttr2_Display_Key"  description-key="newAttr2_Desc_Key"  of-type="DateAndTime.DateAndTime"  usage="bound" required="true" />
    <property name="newAttr3"  display-name-key="newAttr3_Display_Key"  description-key="newAttr3_Desc_Key"  of-type="DateAndTime.DateOnly"     usage="bound" required="true" />
    <property name="newAttr4"  display-name-key="newAttr4_Display_Key"  description-key="newAttr4_Desc_Key"  of-type="Decimal"                  usage="bound" required="true" />
    <property name="newAttr5"  display-name-key="newAttr5_Display_Key"  description-key="newAttr5_Desc_Key"  of-type="Enum"                     usage="bound" required="true" />
    <property name="newAttr6"  display-name-key="newAttr6_Display_Key"  description-key="newAttr6_Desc_Key"  of-type="FP"                       usage="bound" required="true" />
    <property name="newAttr7"  display-name-key="newAttr7_Display_Key"  description-key="newAttr7_Desc_Key"  of-type="Multiple"                 usage="bound" required="true" />
    <property name="newAttr8"  display-name-key="newAttr8_Display_Key"  description-key="newAttr8_Desc_Key"  of-type="OptionSet"                usage="bound" required="true" />
    <property name="newAttr9"  display-name-key="newAttr9_Display_Key"  description-key="newAttr9_Desc_Key"  of-type="SingleLine.Email"         usage="bound" required="true" />
    <property name="newAttr10" display-name-key="newAttr10_Display_Key" description-key="newAttr10_Desc_Key" of-type="SingleLine.Phone"         usage="bound" required="true" />
    <property name="newAttr11" display-name-key="newAttr11_Display_Key" description-key="newAttr11_Desc_Key" of-type="SingleLine.Text"          usage="bound" required="true" />
    <property name="newAttr12" display-name-key="newAttr12_Display_Key" description-key="newAttr12_Desc_Key" of-type="SingleLine.TextArea"      usage="bound" required="true" />
    <property name="newAttr13" display-name-key="newAttr13_Display_Key" description-key="newAttr13_Desc_Key" of-type="SingleLine.Ticker"        usage="bound" required="true" />
    <property name="newAttr14" display-name-key="newAttr14_Display_Key" description-key="newAttr14_Desc_Key" of-type="SingleLine.URL"           usage="bound" required="true" />
    <property name="newAttr15" display-name-key="newAttr15_Display_Key" description-key="newAttr15_Desc_Key" of-type="TwoOptions"               usage="bound" required="true" />
    <property name="newAttr16" display-name-key="newAttr16_Display_Key" description-key="newAttr16_Desc_Key" of-type="Whole.None"               usage="bound" required="true" />
...
ManifestTypes.d.ts
export interface IOutputs {
    newAttr1?: number;
    newAttr2?: Date;
    newAttr3?: Date;
    newAttr4?: number;
    newAttr5?: string;
    newAttr6?: number;
    newAttr7?: string;
    newAttr8?: number;
    newAttr9?: string;
    newAttr10?: string;
    newAttr11?: string;
    newAttr12?: string;
    newAttr13?: string;
    newAttr14?: string;
    newAttr15?: boolean;
    newAttr16?: number;
}
kojisaiki
@saikou9901 Support Engineer/Everything is a stream. github: https://github.com/kojisaiki
http://irony9901.hatenablog.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした