1 cup (2 sticks) unsalted butter, softened
1/2 cup granulated sugar
3/4 cup packed light-brown sugar
2 large eggs
1 teaspoon pure vanilla extract
1 3/4 cups all-purpose flour
1/4 cup unsweetened Dutch-process cocoa powder
1 teaspoon baking soda
1/2 teaspoon baking powder
1/2 teaspoon coarse salt
2 cups white-chocolate chunks
1 3/4 cups sweetened flaked coconut
1 3/4 cups coarsely chopped walnuts (optional)
Preheat oven to 350F. Line a cookie sheet with silpat or parchment paper.
Place butter and sugars in the bowl of an electric mixer fitted with the paddle attachment; mix on medium speed until smooth, about 2 minutes. Mix in eggs, 1 at a time. Stir in vanilla.
Sift flour, cocoa powder, baking soda, baking powder, and salt into a medium bowl. Mix into butter mixture on low speed until well combined. Stir in chocolate, coconut, and walnuts, if using.
Drop batter in 2 tablespoon scoops onto cookie sheets, spacing 2 inches apart. Flatten slightly. Bake until set, 10 to 12 minutes. Let cool on sheets on wire racks 2 minutes. Transfer cookies to racks to cool completely.