Skip to content

Commit ac7587a

Browse files
committed
docs: replaced extends w/ implements keyword in classes
1 parent 482b6d8 commit ac7587a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Diff for: docs/core/logger.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Key | Example
151151

152152
const logger = new Logger();
153153

154-
class Lambda extends LambdaInterface {
154+
class Lambda implements LambdaInterface {
155155
// Decorate your handler class method
156156
@logger.injectLambdaContext()
157157
public async handler(_event: any, _context: any): Promise<void> {
@@ -589,7 +589,7 @@ For example, by setting the "sample rate" to `0.5`, roughly 50% of your lambda i
589589

590590
### Custom Log formatter (Bring Your Own Formatter)
591591

592-
You can customize the structure (keys and values) of your log items by passing a custom log formatter, an object that extends the `LogFormatter` abstract class.
592+
You can customize the structure (keys and values) of your log items by passing a custom log formatter, an object that implements the `LogFormatter` abstract class.
593593

594594
=== "handler.ts"
595595

@@ -631,7 +631,7 @@ This is how the `MyCompanyLogFormatter` (dummy name) would look like:
631631
// Replace this line with your own type
632632
type MyCompanyLog = LogAttributes;
633633

634-
class MyCompanyLogFormatter extends LogFormatter {
634+
class MyCompanyLogFormatter implements LogFormatter {
635635

636636
public formatAttributes(attributes: UnformattedAttributes): MyCompanyLog {
637637
return {

Diff for: docs/core/metrics.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ You can add default dimensions to your metrics by passing them as parameters in
253253
const metrics = new Metrics({ namespace: 'serverlessAirline', service: 'orders' });
254254
const DEFAULT_DIMENSIONS = { 'environment': 'prod', 'foo': 'bar' };
255255

256-
export class MyFunction extends LambdaInterface {
256+
export class MyFunction implements LambdaInterface {
257257
// Decorate your handler class method
258258
@metrics.logMetrics({defaultDimensions: DEFAULT_DIMENSIONS})
259259
public handler(_event: any, _context: any): Promise<void> {
@@ -396,7 +396,7 @@ The `logMetrics` decorator of the metrics utility can be used when your Lambda h
396396

397397
const metrics = new Metrics({ namespace: 'serverlessAirline', service: 'orders' });
398398

399-
export class MyFunction extends LambdaInterface {
399+
export class MyFunction implements LambdaInterface {
400400

401401
@metrics.logMetrics()
402402
public async handler(_event: any, _context: any): Promise<void> {
@@ -477,7 +477,7 @@ You can optionally capture cold start metrics with the `logMetrics` middleware o
477477

478478
const metrics = new Metrics({namespace: 'serverlessAirline', service: 'orders' });
479479

480-
export class MyFunction extends LambdaInterface {
480+
export class MyFunction implements LambdaInterface {
481481

482482
@metrics.logMetrics({ captureColdStartMetric: true })
483483
public async handler(_event: any, _context: any): Promise<void> {
@@ -599,7 +599,7 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use `singleMetr
599599

600600
const metrics = new Metrics({ namespace: 'serverlessAirline', service: 'orders' });
601601

602-
class Lambda extends LambdaInterface {
602+
class Lambda implements LambdaInterface {
603603

604604
@metrics.logMetrics()
605605
public async handler(_event: any, _context: any): Promise<void> {

Diff for: docs/core/tracer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ You can quickly start by importing the `Tracer` class, initialize it outside the
155155

156156
const tracer = new Tracer({ serviceName: 'serverlessAirline' });
157157

158-
class Lambda extends LambdaInterface {
158+
class Lambda implements LambdaInterface {
159159
// Decorate your handler class method
160160
@tracer.captureLambdaHandler()
161161
public async handler(_event: any, _context: any): Promise<void> {
@@ -262,7 +262,7 @@ You can trace other methods using the `captureMethod` decorator or manual instru
262262

263263
const tracer = new Tracer({ serviceName: 'serverlessAirline' });
264264

265-
class Lambda extends LambdaInterface {
265+
class Lambda implements LambdaInterface {
266266
// Decorate your class method
267267
@tracer.captureMethod()
268268
public getChargeId(): string {

0 commit comments

Comments
 (0)