Skip to content

Commit 265eed8

Browse files
Remove TS 'satisfies' syntax to fix build
Signed-off-by: Andrei Floricel <andrei.floricel@gmail.com>
1 parent e5449d7 commit 265eed8

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

.prettierignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@
99
website
1010
dist
1111
src/app-directory/*/target
12-
13-
# temporary, until Prettier is upgraded to at least v2.8, which supports the TS 'satisfies' syntax
14-
src/**/IntentsConfiguration.ts

src/bridging/BridgingTypes.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575
// These functions will throw an error if the JSON doesn't
7676
// match the expected interface, even if the JSON is valid.
7777

78-
import { Intent } from '../intents/Intents';
79-
8078
/**
8179
* Metadata relating to the FDC3 Desktop Agent implementation and its provider.
8280
*/
@@ -1772,7 +1770,7 @@ export interface FindIntentAgentRequestMeta {
17721770
*/
17731771
export interface FindIntentAgentRequestPayload {
17741772
context?: ContextElement;
1775-
intent: Intent;
1773+
intent: string;
17761774
resultType?: string;
17771775
}
17781776

@@ -1846,7 +1844,7 @@ export interface IntentMetadata {
18461844
/**
18471845
* The unique name of the intent that can be invoked by the raiseIntent call
18481846
*/
1849-
name: Intent;
1847+
name: string;
18501848
}
18511849

18521850
/**
@@ -1931,7 +1929,7 @@ export interface FindIntentBridgeRequestMeta {
19311929
*/
19321930
export interface FindIntentBridgeRequestPayload {
19331931
context?: ContextElement;
1934-
intent: Intent;
1932+
intent: string;
19351933
resultType?: string;
19361934
}
19371935

@@ -3699,7 +3697,7 @@ export interface RaiseIntentAgentRequestMeta {
36993697
export interface RaiseIntentAgentRequestPayload {
37003698
app: AppDestinationIdentifier;
37013699
context: ContextElement;
3702-
intent: Intent;
3700+
intent: string;
37033701
}
37043702

37053703
/**
@@ -3776,7 +3774,7 @@ export interface IntentResolution {
37763774
* The intent that was raised. May be used to determine which intent the user
37773775
* chose in response to `fdc3.raiseIntentForContext()`.
37783776
*/
3779-
intent: Intent;
3777+
intent: string;
37803778
/**
37813779
* Identifier for the app instance that was selected (or started) to resolve the intent.
37823780
* `source.instanceId` MUST be set, indicating the specific app instance that
@@ -3872,7 +3870,7 @@ export interface RaiseIntentBridgeRequestMeta {
38723870
export interface RaiseIntentBridgeRequestPayload {
38733871
app: AppDestinationIdentifier;
38743872
context: ContextElement;
3875-
intent: Intent;
3873+
intent: string;
38763874
}
38773875

38783876
/**

src/intents/IntentsConfiguration.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ export const IntentsConfiguration = {
3434
ViewProfile: ['fdc3.contact', 'fdc3.organization', 'fdc3.nothing'],
3535
ViewQuote: ['fdc3.instrument', 'fdc3.nothing'],
3636
ViewResearch: ['fdc3.contact', 'fdc3.instrument', 'fdc3.organization', 'fdc3.nothing'],
37-
} satisfies Record<StandardIntent, StandardContextType[]>;
37+
};
38+
// TODO - TSDX's Prettier version does not support 'satisfies' construct
39+
// that's unfortunate because this syntax ensures that the IntentsConfiguration Map is always kep in sync with the StandardIntent type
40+
// satisfies Record<StandardIntent, StandardContextType[]>;
3841

3942
const STANDARD_CONTEXT_TYPES: Readonly<StandardContextType[]> = [
4043
'fdc3.action',

0 commit comments

Comments
 (0)