Skip to content

Commit 06bf40e

Browse files
authored
chore(packages): replace Object interface with Record type (#3683)
1 parent bc87c33 commit 06bf40e

File tree

7 files changed

+10
-30
lines changed

7 files changed

+10
-30
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { Provider } from "@aws-sdk/types";
22

3-
export interface Logins {
4-
[providerName: string]: string | Provider<string>;
5-
}
3+
export type Logins = Record<string, string | Provider<string>>;
64

7-
export interface ResolvedLogins {
8-
[providerName: string]: string;
9-
}
5+
export type ResolvedLogins = Record<string, string>;

packages/eventstream-marshaller/src/Message.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ export interface Message {
1010
body: Uint8Array;
1111
}
1212

13-
export interface MessageHeaders {
14-
[name: string]: MessageHeaderValue;
15-
}
13+
export type MessageHeaders = Record<string, MessageHeaderValue>;
1614

1715
export interface BooleanHeaderValue {
1816
type: "boolean";

packages/eventstream-marshaller/src/vectorTypes.fixture.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ export interface PositiveTestVector {
1313

1414
export type TestVector = NegativeTestVector | PositiveTestVector;
1515

16-
export interface TestVectors {
17-
[vectorName: string]: TestVector;
18-
}
16+
export type TestVectors = Record<string, TestVector>;

packages/middleware-header-default/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { HttpRequest } from "@aws-sdk/protocol-http";
22
import { BuildHandler, BuildHandlerArguments, BuildMiddleware } from "@aws-sdk/types";
33

4-
export interface HeaderDefaultArgs {
5-
[header: string]: string;
6-
}
4+
export type HeaderDefaultArgs = Record<string, string>;
75

86
export function headerDefault(headerBag: HeaderDefaultArgs): BuildMiddleware<any, any> {
97
return (next: BuildHandler<any, any>) => {

packages/types/src/eventStream.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ export interface Message {
1616
body: Uint8Array;
1717
}
1818

19-
export interface MessageHeaders {
20-
[name: string]: MessageHeaderValue;
21-
}
19+
export type MessageHeaders = Record<string, MessageHeaderValue>;
2220

2321
export interface BooleanHeaderValue {
2422
type: "boolean";

packages/types/src/http.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ export interface Headers extends Map<string, string> {
3939
* properties in favor of the other. The headers may or may not be combined, and
4040
* the SDK will not deterministically select which header candidate to use.
4141
*/
42-
export interface HeaderBag {
43-
[key: string]: string;
44-
}
42+
export type HeaderBag = Record<string, string>;
4543

4644
/**
4745
* Represents an HTTP message with headers and an optional static or streaming
@@ -57,9 +55,7 @@ export interface HttpMessage {
5755
* second being used when a parameter contains a list of values. Value can be set
5856
* to null when query is not in key-value pairs shape
5957
*/
60-
export interface QueryParameterBag {
61-
[key: string]: string | Array<string> | null;
62-
}
58+
export type QueryParameterBag = Record<string, string | Array<string> | null>;
6359

6460
export interface Endpoint {
6561
protocol: string;

packages/types/src/profile.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
export interface IniSection {
2-
[key: string]: string | undefined;
3-
}
1+
export type IniSection = Record<string, string | undefined>;
42

53
/**
64
* @deprecated: Please use IniSection
75
*/
86
export interface Profile extends IniSection {}
97

10-
export interface ParsedIniData {
11-
[key: string]: IniSection;
12-
}
8+
export type ParsedIniData = Record<string, IniSection>;
139

1410
export interface SharedConfigFiles {
1511
credentialsFile: ParsedIniData;

0 commit comments

Comments
 (0)